From: Niels Möller Date: Sat, 20 Jan 2024 15:52:52 +0000 (+0100) Subject: Rename macros X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755910d5c7fb838d0c900c721e4163bc8184eb56;p=thirdparty%2Fnettle.git Rename macros --- diff --git a/powerpc64/machine.m4 b/powerpc64/machine.m4 index a94fd615..3a05e318 100644 --- a/powerpc64/machine.m4 +++ b/powerpc64/machine.m4 @@ -65,17 +65,17 @@ define(`INC_VR',`ifelse(substr($1,0,1),`v', `eval($2+$1)')') C Apply op x, x, y, for each x. -C OP_YXX(OP, Y, X1, X2, ...) -define(`OP_YXX', +C OPN_XXY(OP, Y, X1, X2, ...) +define(`OPN_XXY', `$1 $3, $3, $2 ifelse(eval($# > 3), 1, -`OP_YXX($1, $2, shift(shift(shift($@))))dnl +`OPN_XXY($1, $2, shift(shift(shift($@))))dnl ')') C Apply op x, x, x, y, for each x. -C OP_YXXX(OP, Y, X1, X2, ...) -define(`OP_YXXX', +C OPN_XXXY(OP, Y, X1, X2, ...) +define(`OPN_XXXY', `$1 $3, $3, $3, $2 ifelse(eval($# > 3), 1, -`OP_YXXX($1, $2, shift(shift(shift($@))))dnl +`OPN_XXXY($1, $2, shift(shift(shift($@))))dnl ')') diff --git a/powerpc64/p8/aes-decrypt-internal.asm b/powerpc64/p8/aes-decrypt-internal.asm index 12179cbf..1c33f279 100644 --- a/powerpc64/p8/aes-decrypt-internal.asm +++ b/powerpc64/p8/aes-decrypt-internal.asm @@ -110,9 +110,9 @@ Lx8_loop: lxvd2x VSR(S6),r30,SRC lxvd2x VSR(S7),r31,SRC -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') - OP_YXX(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) mtctr ROUNDS li r10,0x10 @@ -120,16 +120,16 @@ IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') L8x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vncipher, ZERO, S0, S1, S2, S3, S4, S5, S6, S7) - OP_YXX(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vncipher, ZERO, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) addi r10,r10,0x10 bdnz L8x_round_loop lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vncipherlast, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vncipherlast, K, S0, S1, S2, S3, S4, S5, S6, S7) -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') stxvd2x VSR(S0),0,DST stxvd2x VSR(S1),r25,DST @@ -171,9 +171,9 @@ L4x: addi r9,r9,0x10 lxvd2x VSR(S3),r9,SRC -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3)') - OP_YXX(vxor, K, S0, S1, S2, S3) + OPN_XXY(vxor, K, S0, S1, S2, S3) mtctr ROUNDS li r10,0x10 @@ -181,16 +181,16 @@ IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') L4x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vncipher, ZERO, S0, S1, S2, S3) - OP_YXX(vxor, K, S0, S1, S2, S3) + OPN_XXY(vncipher, ZERO, S0, S1, S2, S3) + OPN_XXY(vxor, K, S0, S1, S2, S3) addi r10,r10,0x10 bdnz L4x_round_loop lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vncipherlast, K, S0, S1, S2, S3) + OPN_XXY(vncipherlast, K, S0, S1, S2, S3) -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3)') stxvd2x VSR(S0),0,DST li r9,0x10 diff --git a/powerpc64/p8/aes-encrypt-internal.asm b/powerpc64/p8/aes-encrypt-internal.asm index cd959f9e..9ae8bc0e 100644 --- a/powerpc64/p8/aes-encrypt-internal.asm +++ b/powerpc64/p8/aes-encrypt-internal.asm @@ -102,9 +102,9 @@ Lx8_loop: lxvd2x VSR(S6),r30,SRC lxvd2x VSR(S7),r31,SRC -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') - OP_YXX(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vxor, K, S0, S1, S2, S3, S4, S5, S6, S7) mtctr ROUNDS li r10,0x10 @@ -112,15 +112,15 @@ IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') L8x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vcipher, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vcipher, K, S0, S1, S2, S3, S4, S5, S6, S7) addi r10,r10,0x10 bdnz L8x_round_loop lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vcipherlast, K, S0, S1, S2, S3, S4, S5, S6, S7) + OPN_XXY(vcipherlast, K, S0, S1, S2, S3, S4, S5, S6, S7) -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3,S4,S5,S6,S7)') stxvd2x VSR(S0),0,DST stxvd2x VSR(S1),r25,DST @@ -162,9 +162,9 @@ L4x: addi r9,r9,0x10 lxvd2x VSR(S3),r9,SRC -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3)') - OP_YXX(vxor, K, S0, S1, S2, S3) + OPN_XXY(vxor, K, S0, S1, S2, S3) mtctr ROUNDS li r10,0x10 @@ -172,15 +172,15 @@ IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') L4x_round_loop: lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vcipher, K, S0, S1, S2, S3) + OPN_XXY(vcipher, K, S0, S1, S2, S3) addi r10,r10,0x10 bdnz L4x_round_loop lxvd2x VSR(K),r10,KEYS vperm K,K,K,SWAP_MASK - OP_YXX(vcipherlast, K, S0, S1, S2, S3) + OPN_XXY(vcipherlast, K, S0, S1, S2, S3) -IF_LE(`OP_YXXX(vperm, SWAP_MASK, S0,S1,S2,S3)') +IF_LE(`OPN_XXXY(vperm, SWAP_MASK, S0,S1,S2,S3)') stxvd2x VSR(S0),0,DST li r9,0x10