Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreak PowerPC build on macOS #419

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/greenlet/platform/switch_ppc_macosx.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ slp_switch(void)
int err;
int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("; asm block 2\n\tmr %0, r1" : "=g" (stackref) : );
__asm__ ("; asm block 2\n\tmr %0, r1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
Expand All @@ -58,7 +58,7 @@ slp_switch(void)
"\tadd r1, r1, r11\n"
"\tadd r30, r30, r11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "r11"
);
SLP_RESTORE_STATE();
Expand Down
4 changes: 2 additions & 2 deletions src/greenlet/platform/switch_ppc_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ slp_switch(void)
int err;
int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("mr %0, 1" : "=g" (stackref) : );
__asm__ ("mr %0, 1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
"mr 11, %0\n"
"add 1, 1, 11\n"
"add 30, 30, 11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "11"
);
SLP_RESTORE_STATE();
Expand Down
2 changes: 1 addition & 1 deletion src/greenlet/slp_platformselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
# include "platform/switch_ppc64_linux.h" /* gcc on PowerPC 64-bit */
#elif defined(__GNUC__) && defined(__PPC__) && (defined(__linux__) || defined(__FreeBSD__))
# include "platform/switch_ppc_linux.h" /* gcc on PowerPC */
#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__)
#elif defined(__GNUC__) && defined(__POWERPC__) && defined(__APPLE__)
# include "platform/switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */
#elif defined(__GNUC__) && defined(__powerpc64__) && defined(_AIX)
# include "platform/switch_ppc64_aix.h" /* gcc on AIX/PowerPC 64-bit */
Expand Down
Loading