public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: x86@kernel.org, Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>,
	linux-crypto@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] raid6/algos.c: refactor raid6_algos array for x86
Date: Tue, 21 Apr 2020 16:39:47 +0900	[thread overview]
Message-ID: <20200421073947.586662-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20200421073947.586662-1-masahiroy@kernel.org>

Factor out the common pointer references.

Common for i386 and x86_64:
  raid6_avx512x2
  raid6_avx512x1
  raid6_avx2x2
  raid6_avx2x1
  raid6_sse2x2
  raid6_sse2x1
  raid6_sse1x2

Only for i386:
  raid6_sse1x1
  raid6_mmxx2
  raid6_mmxx1

Only for x86_64:
  raid6_avx512x4
  raid6_avx2x4
  raid6_sse2x4

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 lib/raid6/algos.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
index 978fa19efbbf..c0f2fd6e0621 100644
--- a/lib/raid6/algos.c
+++ b/lib/raid6/algos.c
@@ -30,32 +30,28 @@ EXPORT_SYMBOL_GPL(raid6_call);
 
 const struct raid6_calls * const raid6_algos[] = {
 #ifdef CONFIG_X86
-#if defined(CONFIG_X86_32)
 #ifdef CONFIG_AS_AVX512
-	&raid6_avx512x2,
-	&raid6_avx512x1,
-#endif
-	&raid6_avx2x2,
-	&raid6_avx2x1,
-	&raid6_sse2x2,
-	&raid6_sse2x1,
-	&raid6_sse1x2,
-	&raid6_sse1x1,
-	&raid6_mmxx2,
-	&raid6_mmxx1,
-#endif
 #if defined(CONFIG_X86_64)
-#ifdef CONFIG_AS_AVX512
 	&raid6_avx512x4,
+#endif
 	&raid6_avx512x2,
 	&raid6_avx512x1,
 #endif
+#ifdef CONFIG_X86_64
 	&raid6_avx2x4,
+#endif
 	&raid6_avx2x2,
 	&raid6_avx2x1,
+#ifdef CONFIG_X86_64
 	&raid6_sse2x4,
+#endif
 	&raid6_sse2x2,
 	&raid6_sse2x1,
+	&raid6_sse1x2,
+#ifdef CONFIG_X86_32
+	&raid6_sse1x1,
+	&raid6_mmxx2,
+	&raid6_mmxx1,
 #endif
 #endif /* CONFIG_X86 */
 #ifdef CONFIG_ALTIVEC
-- 
2.25.1


      reply	other threads:[~2020-04-21  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21  7:39 [PATCH 1/2] x86: check CONFIG options instead of __arch_um__ Masahiro Yamada
2020-04-21  7:39 ` Masahiro Yamada [this message]

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=20200421073947.586662-2-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox