All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Lafreniere <peter@n8pjl.ca>
To: linux-crypto@vger.kernel.org
Cc: Peter Lafreniere <peter@n8pjl.ca>,
	x86@kernel.org, jussi.kivilinna@mbnet.fi
Subject: [PATCH 3/3] crypto: x86/twofish-3way - Remove unused macro argument
Date: Sun,  5 Feb 2023 22:31:35 -0500	[thread overview]
Message-ID: <39dcdd3216a4163e43cb922892047c86a2a6abef.1675653010.git.peter@n8pjl.ca> (raw)
In-Reply-To: <cover.1675653010.git.peter@n8pjl.ca>

The outunpack3() macro has an op parameter that is only ever called with
"mov". Removing that argument altogether leads to gains to code
readability. There is no effect on the resulting binary.

Signed-off-by: Peter Lafreniere <peter@n8pjl.ca>
---
 arch/x86/crypto/twofish-x86_64-asm_64-3way.S | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
index 29e0fe664386..c2cd9b5406da 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
@@ -182,23 +182,23 @@
 	movq 4*(8+(n))(in),		xy ## 2; \
 	xorq w+4*m(CTX),		xy ## 2;
 
-#define outunpack3(op, out, n, xy, m) \
+#define outunpack3(out, n, xy, m) \
 	xorq w+4*m(CTX),		xy ## 0; \
-	op ## q xy ## 0,		4*(n)(out); \
+	movq xy ## 0,			4*(n)(out); \
 	\
 	xorq w+4*m(CTX),		xy ## 1; \
-	op ## q xy ## 1,		4*(4+(n))(out); \
+	movq xy ## 1,			4*(4+(n))(out); \
 	\
 	xorq w+4*m(CTX),		xy ## 2; \
-	op ## q xy ## 2,		4*(8+(n))(out);
+	movq xy ## 2,			4*(8+(n))(out);
 
 #define inpack_enc3() \
 	inpack3(RIO, 0, RAB, 0); \
 	inpack3(RIO, 2, RCD, 2);
 
-#define outunpack_enc3(op) \
-	outunpack3(op, RIO, 2, RAB, 6); \
-	outunpack3(op, RIO, 0, RCD, 4);
+#define outunpack_enc3() \
+	outunpack3(RIO, 2, RAB, 6); \
+	outunpack3(RIO, 0, RCD, 4);
 
 #define inpack_dec3() \
 	inpack3(RIO, 0, RAB, 4); \
@@ -214,11 +214,11 @@
 	rorq $32,			RCD0; \
 	rorq $32,			RCD1; \
 	rorq $32,			RCD2; \
-	outunpack3(mov, RIO, 0, RCD, 0); \
+	outunpack3(RIO, 0, RCD, 0); \
 	rorq $32,			RAB0; \
 	rorq $32,			RAB1; \
 	rorq $32,			RAB2; \
-	outunpack3(mov, RIO, 2, RAB, 2);
+	outunpack3(RIO, 2, RAB, 2);
 
 #define outunpack_cbc_dec3() \
 	rorq $32,			RCD0; \
@@ -226,13 +226,13 @@
 	xorq (RT1),			RCD1; \
 	rorq $32,			RCD2; \
 	xorq 16(RT1),			RCD2; \
-	outunpack3(mov, RIO, 0, RCD, 0); \
+	outunpack3(RIO, 0, RCD, 0); \
 	rorq $32,			RAB0; \
 	rorq $32,			RAB1; \
 	xorq 8(RT1),			RAB1; \
 	rorq $32,			RAB2; \
 	xorq 24(RT1),			RAB2; \
-	outunpack3(mov, RIO, 2, RAB, 2);
+	outunpack3(RIO, 2, RAB, 2);
 
 SYM_FUNC_START(twofish_enc_blk_3way)
 	/* input:
@@ -261,7 +261,7 @@ SYM_FUNC_START(twofish_enc_blk_3way)
 
 	popq RIO; /* dst */
 
-	outunpack_enc3(mov);
+	outunpack_enc3();
 
 	popq %rbx;
 	popq %r12;
-- 
2.39.1


  parent reply	other threads:[~2023-02-06  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  3:24 [PATCH 0/3] crypto: x86/twofish-3way - Cleanup and optimize asm Peter Lafreniere
2023-02-06  3:31 ` [PATCH 1/3] crypto: x86/twofish-3way - Remove unused encode parameter Peter Lafreniere
2023-02-06  3:31 ` [PATCH 2/3] crypto: x86/twofish-3way - Perform cbc xor in assembly Peter Lafreniere
2023-02-06  3:31 ` Peter Lafreniere [this message]
2023-02-14  8:44 ` [PATCH 0/3] crypto: x86/twofish-3way - Cleanup and optimize asm Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39dcdd3216a4163e43cb922892047c86a2a6abef.1675653010.git.peter@n8pjl.ca \
    --to=peter@n8pjl.ca \
    --cc=jussi.kivilinna@mbnet.fi \
    --cc=linux-crypto@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.