Maamoun TK maamoun.tk@googlemail.com writes:
Use explicit register names to improve the syntax of assembly files and pass -mregnames to the assembler to allow building the assembly files. I will make a stand-alone patch for GCM which brings all the accumulated modifications so it can be directly merged.
configure.ac | 4 +- powerpc64/machine.m4 | 4 +- powerpc64/p8/aes-decrypt-internal.asm | 194 +++++++++++++++++----------------- powerpc64/p8/aes-encrypt-internal.asm | 192 ++++++++++++++++----------------- 4 files changed, 198 insertions(+), 196 deletions(-)
diff --git a/configure.ac b/configure.ac index 666b2f4a..6ab32f03 100644 --- a/configure.ac +++ b/configure.ac @@ -458,10 +458,12 @@ if test "x$enable_assembler" = xyes ; then if test "$ABI" = 64 ; then asm_path="powerpc64" if test "x$enable_fat" = xyes ; then
- asm_path="powerpc64/fat $asm_path"
- CFLAGS="$CFLAGS -Wa,-mregnames"
- asm_path="powerpc64/fat $asm_path"
I'm not sure it's a good idea to unconditionally use these gcc specific flags. Are they supported by all relevant compilers? I'm considering instead adding the attached patch. It's a pretty large file with various m4 utilities plus an autoconf test to determine if the assembler accepts register names (copied from gmp), and then conditionally doing
forloop(i,0,31,`deflit(`r'i,i)')
to define register names as macros expanding to corresponding integers.
This could be extended with a configure check to try adding -Wa,-mregnames.
diff --git a/powerpc64/machine.m4 b/powerpc64/machine.m4 index 221fa523..cefabc9b 100644 --- a/powerpc64/machine.m4 +++ b/powerpc64/machine.m4 @@ -24,7 +24,7 @@ define(`EPILOGUE',
C Get vector-scalar register from vector register C VSR(VR) -define(`VSR',`32+$1') +define(`VSR',``vs'eval(32+substr($1,1,len($1)))')
May be less brittle with an explicit ifelse chain, like the similar macros in arm/machine.m4. Should work better with the above approach, where r1 may expand to 1, depending on a configure check.