Commit 26d53a9c authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

crypto: powerpc - Use address generation helper for asm

Replace open-coded toc-relative address calculation with helper macros,
commit dab3b8f4 ("powerpc/64: asm use consistent global variable
declaration and access") made similar conversions already but missed
this one.

This allows data addressing model to be changed more easily.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230203113858.1152093-2-npiggin@gmail.com
parent e64e7105
...@@ -113,9 +113,7 @@ FUNC_START(CRC_FUNCTION_NAME) ...@@ -113,9 +113,7 @@ FUNC_START(CRC_FUNCTION_NAME)
#endif #endif
#ifdef BYTESWAP_DATA #ifdef BYTESWAP_DATA
addis r3,r2,.byteswap_constant@toc@ha LOAD_REG_ADDR(r3, .byteswap_constant)
addi r3,r3,.byteswap_constant@toc@l
lvx byteswap,0,r3 lvx byteswap,0,r3
addi r3,r3,16 addi r3,r3,16
#endif #endif
...@@ -150,8 +148,7 @@ FUNC_START(CRC_FUNCTION_NAME) ...@@ -150,8 +148,7 @@ FUNC_START(CRC_FUNCTION_NAME)
addi r7,r7,-1 addi r7,r7,-1
mtctr r7 mtctr r7
addis r3,r2,.constants@toc@ha LOAD_REG_ADDR(r3, .constants)
addi r3,r3,.constants@toc@l
/* Find the start of our constants */ /* Find the start of our constants */
add r3,r3,r8 add r3,r3,r8
...@@ -506,8 +503,7 @@ FUNC_START(CRC_FUNCTION_NAME) ...@@ -506,8 +503,7 @@ FUNC_START(CRC_FUNCTION_NAME)
.Lbarrett_reduction: .Lbarrett_reduction:
/* Barrett constants */ /* Barrett constants */
addis r3,r2,.barrett_constants@toc@ha LOAD_REG_ADDR(r3, .barrett_constants)
addi r3,r3,.barrett_constants@toc@l
lvx const1,0,r3 lvx const1,0,r3
lvx const2,off16,r3 lvx const2,off16,r3
...@@ -610,8 +606,7 @@ FUNC_START(CRC_FUNCTION_NAME) ...@@ -610,8 +606,7 @@ FUNC_START(CRC_FUNCTION_NAME)
cmpdi r5,0 cmpdi r5,0
beq .Lzero beq .Lzero
addis r3,r2,.short_constants@toc@ha LOAD_REG_ADDR(r3, .short_constants)
addi r3,r3,.short_constants@toc@l
/* Calculate where in the constant table we need to start */ /* Calculate where in the constant table we need to start */
subfic r6,r5,256 subfic r6,r5,256
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment