summaryrefslogtreecommitdiff
path: root/powerpc64/machine.m4
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2020-09-21 20:07:10 +0200
committerNiels Möller <nisse@lysator.liu.se>2020-09-21 20:07:10 +0200
commit2e6c93ca0f1d3814411b009c90abd2d70e71edea (patch)
treea05632cbc65d502233732a92f24d5215fdd84bc2 /powerpc64/machine.m4
parentdc89647b3033c943f3ac9a82e90dee6299ce0449 (diff)
downloadnettle-2e6c93ca0f1d3814411b009c90abd2d70e71edea.tar.gz
ppc: Add configure test and macros to replace register names.
* aclocal.m4 (GMP_ASM_POWERPC_R_REGISTERS): New configure test, adapted from corresponding test in GMP's acinlude.m4. * configure.ac (ASM_PPC_WANT_R_REGISTERS): New substituted variable. Set using GMP_ASM_POWERPC_R_REGISTERS, when powerpc64 assembly code is enabled. * config.m4.in: Substituted here. * powerpc64/machine.m4: Check ASM_PPC_WANT_R_REGISTERS, and if needed, replace register names like r0, r1, ... with integers. * Makefile.in (%.asm): Include m4-utils.m4 for preprocessing of .asm files, and include config.m4 before machine.m4.
Diffstat (limited to 'powerpc64/machine.m4')
-rw-r--r--powerpc64/machine.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/powerpc64/machine.m4 b/powerpc64/machine.m4
index 221fa523..ae161d79 100644
--- a/powerpc64/machine.m4
+++ b/powerpc64/machine.m4
@@ -34,3 +34,17 @@ C DATA_LOAD_VEC(VEC_DST, DATA_SRC, GPR)
define(`DATA_LOAD_VEC',
`ld $3,$2@got(2)
lvx $1,0,$3')
+
+dnl Usage: r0 ... r31, cr0 ... cr7
+dnl
+dnl Registers names, either left as "r0" etc or mapped to plain 0 etc,
+dnl according to the result of the GMP_ASM_POWERPC_REGISTERS configure
+dnl test.
+
+ifelse(ASM_PPC_WANT_R_REGISTERS,no,`
+forloop(i,0,31,`deflit(`r'i,i)')
+forloop(i,0,31,`deflit(`v'i,i)')
+forloop(i,0,31,`deflit(`f'i,i)')
+forloop(i,0,7, `deflit(`cr'i,i)')
+')
+