From e1f2548e07e0598fe43d572214caf75b79f0db63 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 8 Feb 2005 19:27:32 +0000 Subject: [PATCH] * Some fixes for 64bit AIX on POWER/PowerPC that bring us slightly closer to working (still having some linking problems) This commit was SVN r4327. --- src/asm/asm-data.txt | 1 + src/asm/base/POWERPC64.asm | 42 ++++++++++++++++++++------------------ src/asm/base/aix.conf | 7 ++++--- src/asm/generate-asm.pl | 4 ++++ 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/asm/asm-data.txt b/src/asm/asm-data.txt index 6e50fe1ac3..f0fdcc6137 100644 --- a/src/asm/asm-data.txt +++ b/src/asm/asm-data.txt @@ -29,3 +29,4 @@ POWERPC32 default-.text-.globl-:-_-L--0-1-1-1 powerpc32-64-osx POWERPC32 default-.text-.globl-:--.L-@-1-1-0-0 powerpc32-linux POWERPC32 aix-.csect .text[PR]-.globl-:-.-L--0-0-0-0 powerpc32-aix POWERPC64 default-.text-.globl-:-_-L--0-1-1-1 powerpc64-osx +POWERPC64 aix-.csect .text[PR]-.globl-:-.-L--0-1-0-1 powerpc64-aix diff --git a/src/asm/base/POWERPC64.asm b/src/asm/base/POWERPC64.asm index bbf866a76b..977fcd33fa 100644 --- a/src/asm/base/POWERPC64.asm +++ b/src/asm/base/POWERPC64.asm @@ -1,3 +1,5 @@ +START_FILE + TEXT ALIGN(4) @@ -20,13 +22,13 @@ END_FUNC(ompi_atomic_wmb) START_FUNC(ompi_atomic_cmpset_32) - 1: lwarx r0, 0, r3 + LSYM(1) lwarx r0, 0, r3 cmpw 0, r0, r4 - bne- 2f + bne- REFLSYM(2) stwcx. r5, 0, r3 - bne- 1b + bne- REFLSYM(1) sync - 2: + LSYM(2) cmpw cr7,r0,r4 mfcr r3 rlwinm r3,r3,31,1 @@ -39,9 +41,9 @@ START_FUNC(ompi_atomic_cmpset_acq_32) std r29,-24(r1) std r0,16(r1) stdu r1,-144(r1) - bl _ompi_atomic_cmpset_32 + bl REFGSYM(ompi_atomic_cmpset_32) mr r29,r3 - bl _ompi_atomic_rmb + bl REFGSYM(ompi_atomic_rmb) mr r3,r29 addi r1,r1,144 ld r0,16(r1) @@ -61,11 +63,11 @@ START_FUNC(ompi_atomic_cmpset_rel_32) mr r29,r3 mr r28,r4 mr r27,r5 - bl _ompi_atomic_wmb + bl REFGSYM(ompi_atomic_wmb) mr r3,r29 mr r4,r28 mr r5,r27 - bl _ompi_atomic_cmpset_32 + bl REFGSYM(ompi_atomic_cmpset_32) addi r1,r1,160 ld r0,16(r1) mtlr r0 @@ -77,12 +79,12 @@ END_FUNC(ompi_atomic_cmpset_rel_32) START_FUNC(ompi_atomic_cmpset_64) - 1: ldarx r0, 0, r3 + LSYM(3) ldarx r0, 0, r3 cmpd 0, r0, r4 - bne- 2f + bne- REFLSYM(4) stdcx. r5, 0, r3 - bne- 1b - 2: + bne- REFLSYM(3) + LSYM(4) xor r3,r4,r0 subfic r2,r3,0 adde r3,r2,r3 @@ -95,9 +97,9 @@ START_FUNC(ompi_atomic_cmpset_acq_64) std r29,-24(r1) std r0,16(r1) stdu r1,-144(r1) - bl _ompi_atomic_cmpset_64 + bl REFGSYM(ompi_atomic_cmpset_64) mr r29,r3 - bl _ompi_atomic_rmb + bl REFGSYM(ompi_atomic_rmb) mr r3,r29 addi r1,r1,144 ld r0,16(r1) @@ -117,11 +119,11 @@ START_FUNC(ompi_atomic_cmpset_rel_64) mr r29,r3 mr r28,r4 mr r27,r5 - bl _ompi_atomic_wmb + bl REFGSYM(ompi_atomic_wmb) mr r3,r29 mr r4,r28 mr r5,r27 - bl _ompi_atomic_cmpset_64 + bl REFGSYM(ompi_atomic_cmpset_64) addi r1,r1,160 ld r0,16(r1) mtlr r0 @@ -133,10 +135,10 @@ END_FUNC(ompi_atomic_cmpset_rel_64) START_FUNC(ompi_atomic_add_32) - 1: lwarx r0, 0, r3 + LSYM(5) lwarx r0, 0, r3 add r0, r4, r0 stwcx. r0, 0, r3 - bne- 1b + bne- REFLSYM(5) lwz r3,0(r3) extsw r3,r3 @@ -145,10 +147,10 @@ END_FUNC(ompi_atomic_add_32) START_FUNC(ompi_atomic_sub_32) - 1: lwarx r0,0,r3 + LSYM(6) lwarx r0,0,r3 subf r0,r4,r0 stwcx. r0,0,r3 - bne- 1b + bne- REFLSYM(6) lwz r3,0(r3) extsw r3,r3 diff --git a/src/asm/base/aix.conf b/src/asm/base/aix.conf index f42a460c57..ed34945599 100644 --- a/src/asm/base/aix.conf +++ b/src/asm/base/aix.conf @@ -1,9 +1,10 @@ sub start_file() { - my $ret= "\t.toc\n"; + my $ret = ""; if ($IS64BIT == 1) { $ret .= "\t.machine \"ppc64\"\n"; } + $ret .= "\t.toc\n"; return $ret; } @@ -20,9 +21,9 @@ sub start_func($) $ret .= "$func_name$SUFFIX\n"; if ($IS64BIT == 1) { - $ret .= "\t.llong .$1, TOC[tc0], 0\n"; + $ret .= "\t.llong .$func_name, TOC[tc0], 0\n"; } else { - $ret .= "\t.long .$1, TOC[tc0], 0\n"; + $ret .= "\t.long .$func_name, TOC[tc0], 0\n"; } $ret .= "\t.csect [PR]\n"; diff --git a/src/asm/generate-asm.pl b/src/asm/generate-asm.pl index 34d825118b..eb48fe64bd 100644 --- a/src/asm/generate-asm.pl +++ b/src/asm/generate-asm.pl @@ -48,9 +48,13 @@ do "$basedir/$CONFIG.conf" or die "Could not open config file $basedir/$CONFIG.c while () { s/TEXT/$TEXT/g; s/GLOBAL/$GLOBAL/g; + s/REFGSYM\((.*)\)/$GSYM$1/g; + s/REFLSYM\((.*)\)/$LSYM$1/g; s/GSYM\((.*)\)/$GSYM$1$SUFFIX/g; s/LSYM\((.*)\)/$LSYM$1$SUFFIX/g; + if ($DEL_R_REG == 0) { + s/cr([0-9][0-9]?)/$1/g; s/r([0-9][0-9]?)/$1/g; }