All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Landden <shawn@git.icu>
Cc: Shawn Landden <shawn@git.icu>, Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] powerpc: Allow may_use_simd() to function as feature detection
Date: Tue, 14 May 2019 09:49:18 -0300	[thread overview]
Message-ID: <20190514124918.22590-1-shawn@git.icu> (raw)
In-Reply-To: <20190513005104.20140-1-shawn@git.icu>

ARM does this, so we might as well too.
I am a bit confused however as CONFIG_ALTIVEC does not select
CONFIG_PPC_FPU. Would you ever have altivec without a fpu?

Signed-off-by: Shawn Landden <shawn@git.icu>
---
 arch/powerpc/include/asm/simd.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/include/asm/simd.h b/arch/powerpc/include/asm/simd.h
index 9b066d633..2fe26f258 100644
--- a/arch/powerpc/include/asm/simd.h
+++ b/arch/powerpc/include/asm/simd.h
@@ -7,4 +7,11 @@
  * It's always ok in process context (ie "not interrupt")
  * but it is sometimes ok even from an irq.
  */
+#ifdef CONFIG_PPC_FPU
 extern bool may_use_simd(void);
+#else
+static inline bool may_use_simd(void)
+{
+	return false;
+}
+#endif
-- 
2.21.0.1020.gf2820cf01a


  parent reply	other threads:[~2019-05-14 12:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-12 16:50 [PATCH] powerpc: add simd.h implementation specific to PowerPC Shawn Landden
2019-05-12 16:50 ` Shawn Landden
2019-05-13  0:51 ` [PATCH RESEND] " Shawn Landden
2019-05-13  0:51   ` Shawn Landden
2019-05-13 11:53   ` Michael Ellerman
2019-05-13 11:53     ` Michael Ellerman
2019-05-14  1:44   ` [PATCH 1/2] [PowerPC] Add simd.h implementation Shawn Landden
2019-05-14  1:44     ` [PATCH 2/2] [PowerPC] Allow use of SIMD in interrupts from kernel code Shawn Landden
2019-05-14  5:43     ` [PATCH 1/2] [PowerPC] Add simd.h implementation Benjamin Herrenschmidt
2019-05-14 15:44       ` Shawn Landden
2019-05-14 15:46     ` [v3 " Shawn Landden
2019-05-14 15:46       ` [v3 2/2] [PowerPC] Allow use of SIMD in interrupts from kernel code Shawn Landden
2019-05-15  1:03         ` kbuild test robot
2019-05-14  2:23   ` [v2 1/2] [PowerPC] Add simd.h implementation Shawn Landden
2019-05-14  2:23     ` [v2 2/2] [PowerPC] Allow use of SIMD in interrupts from kernel code Shawn Landden
2019-05-14  7:22       ` Russell Currey
2019-05-14 15:35         ` Shawn Landden
2019-05-14 12:49   ` Shawn Landden [this message]
2019-05-14 18:06     ` [PATCH] powerpc: Allow may_use_simd() to function as feature detection Segher Boessenkool
2019-05-14 19:00       ` Shawn Landden
2019-05-15  1:36   ` [PATCH 1/2] [PowerPC] Add simd.h implementation Shawn Landden
2019-05-15  1:37   ` [v4 PATCH " Shawn Landden
2019-05-15  1:37     ` [v4 PATCH 2/2] [PowerPC] Allow use of SIMD in interrupts from kernel code Shawn Landden
2019-05-15  6:27     ` [v4 PATCH 1/2] [PowerPC] Add simd.h implementation Christophe Leroy
2019-05-16  1:12       ` Shawn Landden
2019-05-18 16:04     ` [RESEND v4 " Shawn Landden
2019-05-18 16:04       ` [RESEND v4 PATCH 2/2] [PowerPC] Allow use of SIMD in interrupts from kernel code Shawn Landden

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=20190514124918.22590-1-shawn@git.icu \
    --to=shawn@git.icu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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.