[Gmp-commit] /var/hg/gmp: Revert remaining parts of recent sparc LEA changes.
mercurial at gmplib.org
mercurial at gmplib.org
Mon Apr 15 16:30:05 CEST 2013
details: /var/hg/gmp/rev/072b7964204b
changeset: 15717:072b7964204b
user: Torbjorn Granlund <tege at gmplib.org>
date: Mon Apr 15 16:30:00 2013 +0200
description:
Revert remaining parts of recent sparc LEA changes.
diffstat:
ChangeLog | 4 +
mpn/sparc32/sparc-defs.m4 | 94 --------------------------------
mpn/sparc32/udiv.asm | 21 +++++-
mpn/sparc32/v8/addmul_1.asm | 12 +++-
mpn/sparc32/v8/mul_1.asm | 12 +++-
mpn/sparc32/v8/supersparc/udiv.asm | 22 +++++-
mpn/sparc32/v8/udiv.asm | 22 +++++-
mpn/sparc64/ultrasparct3/dive_1.asm | 26 +++++++-
mpn/sparc64/ultrasparct3/invert_limb.asm | 6 +-
mpn/sparc64/ultrasparct3/mode1o.asm | 26 +++++++-
10 files changed, 120 insertions(+), 125 deletions(-)
diffs (truncated from 421 to 300 lines):
diff -r bd92f35223f8 -r 072b7964204b ChangeLog
--- a/ChangeLog Sun Apr 14 23:24:54 2013 +0200
+++ b/ChangeLog Mon Apr 15 16:30:00 2013 +0200
@@ -1,3 +1,7 @@
+2013-04-15 Torbjorn Granlund <tege at gmplib.org>
+
+ * Revert remaining parts of recent sparc LEA changes.
+
2013-04-14 David S. Miller <davem at davemloft.net>
* mpn/sparc32/v9/sqr_diagonal.asm: Revert LEA and INT32 changes.
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/sparc-defs.m4
--- a/mpn/sparc32/sparc-defs.m4 Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/sparc-defs.m4 Mon Apr 15 16:30:00 2013 +0200
@@ -35,100 +35,6 @@
`ifelse(HAVE_REGISTER,yes,
`.register `$1',`$2'')')
-dnl Usage: LEA(symbol,reg,pic_reg)
-dnl
-dnl Use whatever code sequence is appropriate to load "symbol" into register
-dnl "reg", potentially using register "pic_reg" to perform the calculations.
-dnl This takes into consideration things like PIC, whether we are generating
-dnl 64-bit code, etc.
-
-define(LEA,
-m4_assert_numargs(3)
-m4_assert_defined(`HAVE_GOTDATA')
-`ifdef(`PIC',`
-ifelse(HAVE_GOTDATA,yes,`
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %`$3'
- call __sparc_get_pc_thunk.`$3'
- or %`$3', %lo(_GLOBAL_OFFSET_TABLE_+4), %`$3'
- sethi %gdop_hix22(`$1'), %`$2'
- xor %`$2', %gdop_lox10(`$1'), %`$2'
-ifdef(`HAVE_ABI_64',`
- ldx [%`$3' + %`$2'], %`$2', %gdop(`$1')',`
- ld [%`$3' + %`$2'], %`$2', %gdop(`$1')')',`
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %`$3'
- call __sparc_get_pc_thunk.`$3'
- or %`$3', %lo(_GLOBAL_OFFSET_TABLE_+4), %`$3'
- sethi %hi(`$1'), %`$2'
- or %`$2', %lo(`$1'), %`$2'
-ifdef(`HAVE_ABI_64',`
- ldx [%`$3' + %`$2'], %`$2'',`
- ld [%`$3' + %`$2'], %`$2'')')',`
-ifdef(`HAVE_ABI_64',`
- setx `$1', %`$3', %`$2'',`
- set `$1', %`$2'')')')
-
-dnl Usage: LEA_LEAF(symbol,reg,pic_reg)
-dnl
-dnl Exactly the same as LEA except that it works in a leaf function.
-dnl Specifically, when generating PIC code, it makes sure to preserve the %o7
-dnl register.
-
-define(LEA_LEAF,
-m4_assert_numargs(3)
-m4_assert_defined(`HAVE_GOTDATA')
-`ifdef(`PIC',`
-ifelse(HAVE_GOTDATA,yes,`
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %`$3'
- mov %o7, %`$2'
- call __sparc_get_pc_thunk.`$3'
- or %`$3', %lo(_GLOBAL_OFFSET_TABLE_+4), %`$3'
- mov %`$2', %o7
- sethi %gdop_hix22(`$1'), %`$2'
- xor %`$2', %gdop_lox10(`$1'), %`$2'
-ifdef(`HAVE_ABI_64',`
- ldx [%`$3' + %`$2'], %`$2', %gdop(`$1')',`
- ld [%`$3' + %`$2'], %`$2', %gdop(`$1')')',`
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %`$3'
- mov %o7, %`$2'
- call __sparc_get_pc_thunk.`$3'
- or %`$3', %lo(_GLOBAL_OFFSET_TABLE_+4), %`$3'
- mov %`$2', %o7
- sethi %hi(`$1'), %`$2'
- or %`$2', %lo(`$1'), %`$2'
-ifdef(`HAVE_ABI_64',`
- ldx [%`$3' + %`$2'], %`$2'',`
- ld [%`$3' + %`$2'], %`$2'')')',`
-ifdef(`HAVE_ABI_64',`
- setx `$1', %`$3', %`$2'',`
- set `$1', %`$2'')')')
-
-dnl Usage: LEA_THUNK(pic_reg)
-dnl
-dnl Files that make use of LEA and LEA_LEAF must emit a PIC thunk using
-dnl LEA_THUNK. The "pic_reg" argument given must exactly the same as the
-dnl one given to the LEA LEA_LEAF invocations.
-dnl
-dnl If multiple PIC registers are used in invocations of LEA and LEA_LEAF then
-dnl multiple thunks needs to be emitted, one for each PIC register used.
-
-define(LEA_THUNK,
-m4_assert_numargs(1)
-m4_assert_defined(`HAVE_SHARED_THUNKS')
-`ifdef(`PIC',`
-ifelse(HAVE_SHARED_THUNKS,yes,`
- .section .text.__sparc_get_pc_thunk.`$1',"axG", at progbits,__sparc_get_pc_thunk.`$1',comdat
- .weak __sparc_get_pc_thunk.`$1'
- .hidden __sparc_get_pc_thunk.`$1'
- .type __sparc_get_pc_thunk.`$1', #function
-__sparc_get_pc_thunk.`$1':
- jmp %o7+8
- add %o7, %`$1', %`$1'
- TEXT
-',`
- TEXT
-__sparc_get_pc_thunk.`$1':
- retl
- add %o7, %`$1', %`$1'')')')
C Testing mechanism for running newer code on older processors
ifdef(`FAKE_T3',`
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/udiv.asm
--- a/mpn/sparc32/udiv.asm Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/udiv.asm Mon Apr 15 16:30:00 2013 +0200
@@ -28,7 +28,13 @@
C d i3
ASM_START()
- LEA_THUNK(l7)
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
TEXT
ALIGN(8)
L(C0): .double 0r4294967296
@@ -39,8 +45,11 @@
st %i1,[%fp-8]
ld [%fp-8],%f10
- LEA(L(C0),l0,l7)
- ldd [%l0], %f8
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
fitod %f10,%f4
cmp %i1,0
@@ -66,8 +75,10 @@
L(250):
fdivd %f2,%f4,%f2
- LEA(L(C1),l0,l7)
- ldd [%l0], %f4
+ifdef(`PIC',
+` ldd [%o7+L(C1)-L(pc)],%f4',
+` sethi %hi(L(C1)),%o7
+ ldd [%o7+%lo(L(C1))],%f4')
fcmped %f2,%f4
nop
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/v8/addmul_1.asm
--- a/mpn/sparc32/v8/addmul_1.asm Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/v8/addmul_1.asm Mon Apr 15 16:30:00 2013 +0200
@@ -28,15 +28,21 @@
C s2_limb o3
ASM_START()
- LEA_THUNK(g4)
- TEXT
PROLOGUE(mpn_addmul_1)
orcc %g0,%g0,%g2
ld [%o1+0],%o4 C 1
sll %o2,4,%g1
and %g1,(4-1)<<4,%g1
- LEA_LEAF(L(1),g3,g4)
+ifdef(`PIC',
+` mov %o7,%g4 C Save return address register
+0: call 1f
+ add %o7,L(1)-0b,%g3
+1: mov %g4,%o7 C Restore return address register
+',
+` sethi %hi(L(1)),%g3
+ or %g3,%lo(L(1)),%g3
+')
jmp %g3+%g1
nop
L(1):
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/v8/mul_1.asm
--- a/mpn/sparc32/v8/mul_1.asm Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/v8/mul_1.asm Mon Apr 15 16:30:00 2013 +0200
@@ -28,12 +28,18 @@
C s2_limb o3
ASM_START()
- LEA_THUNK(g4)
- TEXT
PROLOGUE(mpn_mul_1)
sll %o2,4,%g1
and %g1,(4-1)<<4,%g1
- LEA_LEAF(L(1),g3,g4)
+ifdef(`PIC',
+` mov %o7,%g4 C Save return address register
+0: call 1f
+ add %o7,L(1)-0b,%g3
+1: mov %g4,%o7 C Restore return address register
+',
+` sethi %hi(L(1)),%g3
+ or %g3,%lo(L(1)),%g3
+')
jmp %g3+%g1
ld [%o1+0],%o4 C 1
L(1):
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/v8/supersparc/udiv.asm
--- a/mpn/sparc32/v8/supersparc/udiv.asm Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/v8/supersparc/udiv.asm Mon Apr 15 16:30:00 2013 +0200
@@ -29,18 +29,28 @@
C d i3
ASM_START()
- LEA_THUNK(l7)
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
TEXT
ALIGN(8)
L(C0): .double 0r4294967296
L(C1): .double 0r2147483648
+
PROLOGUE(mpn_udiv_qrnnd)
save %sp,-104,%sp
st %i1,[%fp-8]
ld [%fp-8],%f10
- LEA(L(C0),l0,l7)
- ldd [%l0], %f8
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
fitod %f10,%f4
cmp %i1,0
@@ -66,8 +76,10 @@
L(250):
fdivd %f2,%f4,%f2
- LEA(L(C1),l0,l7)
- ldd [%l0], %f4
+ifdef(`PIC',
+` ldd [%o7+L(C1)-L(pc)],%f4',
+` sethi %hi(L(C1)),%o7
+ ldd [%o7+%lo(L(C1))],%f4')
fcmped %f2,%f4
nop
diff -r bd92f35223f8 -r 072b7964204b mpn/sparc32/v8/udiv.asm
--- a/mpn/sparc32/v8/udiv.asm Sun Apr 14 23:24:54 2013 +0200
+++ b/mpn/sparc32/v8/udiv.asm Mon Apr 15 16:30:00 2013 +0200
@@ -29,18 +29,28 @@
C d i3
ASM_START()
- LEA_THUNK(l7)
+
+ifdef(`PIC',
+` TEXT
+L(getpc):
+ retl
+ nop')
+
TEXT
ALIGN(8)
L(C0): .double 0r4294967296
L(C1): .double 0r2147483648
+
PROLOGUE(mpn_udiv_qrnnd)
save %sp,-104,%sp
st %i1,[%fp-8]
ld [%fp-8],%f10
- LEA(L(C0),l0,l7)
- ldd [%l0], %f8
+ifdef(`PIC',
+`L(pc): call L(getpc) C put address of this insn in %o7
+ ldd [%o7+L(C0)-L(pc)],%f8',
+` sethi %hi(L(C0)),%o7
+ ldd [%o7+%lo(L(C0))],%f8')
fitod %f10,%f4
cmp %i1,0
@@ -66,8 +76,10 @@
L(250):
fdivd %f2,%f4,%f2
More information about the gmp-commit
mailing list