]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
powerpc64: remove use of m4_unquote in the load step for sha256
authorEric Richter <erichte@linux.ibm.com>
Thu, 20 Jun 2024 18:43:57 +0000 (13:43 -0500)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 4 Aug 2024 09:39:02 +0000 (11:39 +0200)
By passing in the constant offset value into the LOAD macro, the use of
m4_unquote to calculate the correct constant GPR can be avoided,
improving readability.

Signed-off-by: Eric Richter <erichte@linux.ibm.com>
powerpc64/p8/sha256-compress-n.asm

index 4848461ef32583e1eae226c1d9ac62e11638440a..309db1fa70abb8f8b3048c0269a820d124a1c194 100644 (file)
@@ -177,34 +177,34 @@ define(`EXTENDROUNDS', `
 ')
 
 define(`LOAD', `
-       IF_BE(`lxvw4x   VSR(IV($1)), m4_unquote(TC`'eval(($1 % 4) * 4)), INPUT')
+       IF_BE(`lxvw4x   VSR(IV($1)), $2, INPUT')
        IF_LE(`
-               lxvd2x  VSR(IV($1)), m4_unquote(TC`'eval(($1 % 4) * 4)), INPUT
+               lxvd2x  VSR(IV($1)), $2, INPUT
                vperm   IV($1), IV($1), IV($1), VT0
        ')
 ')
 
 define(`DOLOADS', `
        IF_LE(`DATA_LOAD_VEC(VT0, .load_swap, T1)')
-       LOAD(0)
-       LOAD(1)
-       LOAD(2)
-       LOAD(3)
+       LOAD(0, TC0)
+       LOAD(1, TC4)
+       LOAD(2, TC8)
+       LOAD(3, TC12)
        addi    INPUT, INPUT, 16
-       LOAD(4)
-       LOAD(5)
-       LOAD(6)
-       LOAD(7)
+       LOAD(4, TC0)
+       LOAD(5, TC4)
+       LOAD(6, TC8)
+       LOAD(7, TC12)
        addi    INPUT, INPUT, 16
-       LOAD(8)
-       LOAD(9)
-       LOAD(10)
-       LOAD(11)
+       LOAD(8, TC0)
+       LOAD(9, TC4)
+       LOAD(10, TC8)
+       LOAD(11, TC12)
        addi    INPUT, INPUT, 16
-       LOAD(12)
-       LOAD(13)
-       LOAD(14)
-       LOAD(15)
+       LOAD(12, TC0)
+       LOAD(13, TC4)
+       LOAD(14, TC8)
+       LOAD(15, TC12)
        addi    INPUT, INPUT, 16
 ')