summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2019-08-25 02:18:39 +0200
committerTorbjorn Granlund <tg@gmplib.org>2019-08-25 02:18:39 +0200
commit9bfc5c10159b2e23e9e654541d9afae6383b7e47 (patch)
treea76d13a65ef479cc1a23060d75e7ba72c0164fe8
parent521a667042b67d58ce36d5ff648d896561365121 (diff)
downloadgmp-9bfc5c10159b2e23e9e654541d9afae6383b7e47.tar.gz
Make logic for determining ABI wrt struct return more robust.
-rw-r--r--mpn/powerpc64/mode64/p7/gcd_22.asm9
-rw-r--r--mpn/powerpc64/mode64/p9/gcd_22.asm9
2 files changed, 12 insertions, 6 deletions
diff --git a/mpn/powerpc64/mode64/p7/gcd_22.asm b/mpn/powerpc64/mode64/p7/gcd_22.asm
index 415b68aa8..ade30e49c 100644
--- a/mpn/powerpc64/mode64/p7/gcd_22.asm
+++ b/mpn/powerpc64/mode64/p7/gcd_22.asm
@@ -43,8 +43,11 @@ C POWER9 10.6
C We define SLOW if this target uses a slow struct return mechanism, with
C r3 as an implicit parameter for the struct pointer.
undefine(`SLOW')dnl
-ifdef(`AIX', `define(`SLOW',`due to AIX')')dnl
-ifdef(`ELFv1_ABI', `define(`SLOW',`due to ELFv1')')dnl
+ifdef(`AIX',`define(`SLOW',`due to AIX')',`
+ ifdef(`DARWIN',,`
+ ifdef(`ELFv2_ABI',,`define(`SLOW',`due to ELFv1')')dnl
+ ')
+')
ifdef(`SLOW',`
define(`IFSLOW', `$1')
@@ -91,7 +94,7 @@ L(bck): and tmp, s0, t0 C 2
srd u1, u1, cnt C 8
or u0, u0, tmp C 10
- or. r0, u1, v1 C 12
+ or. r0, u1, v1 C 10
bne L(top)
diff --git a/mpn/powerpc64/mode64/p9/gcd_22.asm b/mpn/powerpc64/mode64/p9/gcd_22.asm
index 1cd08f558..12d11b090 100644
--- a/mpn/powerpc64/mode64/p9/gcd_22.asm
+++ b/mpn/powerpc64/mode64/p9/gcd_22.asm
@@ -43,8 +43,11 @@ C POWER9 9.58
C We define SLOW if this target uses a slow struct return mechanism, with
C r3 as an implicit parameter for the struct pointer.
undefine(`SLOW')dnl
-ifdef(`AIX', `define(`SLOW',`due to AIX')')dnl
-ifdef(`ELFv1_ABI', `define(`SLOW',`due to ELFv1')')dnl
+ifdef(`AIX',`define(`SLOW',`due to AIX')',`
+ ifdef(`DARWIN',,`
+ ifdef(`ELFv2_ABI',,`define(`SLOW',`due to ELFv1')')dnl
+ ')
+')
ifdef(`SLOW',`
define(`IFSLOW', `$1')
@@ -90,7 +93,7 @@ L(bck): cnttzd cnt, t0 C 2
srd u1, u1, cnt C 8
or u0, u0, tmp C 10
- or. r0, u1, v1 C 8
+ or. r0, u1, v1 C 10
cmpld cr7, v0, u0
bne L(top)