All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: llvmlinux@lists.linuxfoundation.org, linuxppc-dev@lists.ozlabs.org
Cc: Daniel Axtens <dja@axtens.net>
Subject: [RFC PATCH 5/8] poweprc/lib/quad: Provide macros for lq/stq
Date: Thu, 25 Feb 2021 14:10:03 +1100	[thread overview]
Message-ID: <20210225031006.1204774-6-dja@axtens.net> (raw)
In-Reply-To: <20210225031006.1204774-1-dja@axtens.net>

For some reason the integrated assembler in clang-11 doesn't recognise
them. Eventually we should fix it there too.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/include/asm/ppc-opcode.h | 4 ++++
 arch/powerpc/lib/quad.S               | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index ed161ef2b3ca..a5249631cb83 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -339,11 +339,13 @@
 #define PPC_RAW_DARN(t, l)		(0x7c0005e6 | ___PPC_RT(t) | (((l) & 0x3) << 16))
 #define PPC_RAW_DCBAL(a, b)		(0x7c2005ec | __PPC_RA(a) | __PPC_RB(b))
 #define PPC_RAW_DCBZL(a, b)		(0x7c2007ec | __PPC_RA(a) | __PPC_RB(b))
+#define PPC_RAW_LQ(t, a, dq)		(0xe0000000 | ___PPC_RT(t) | ___PPC_RA(a) | (((dq) & 0xfff) << 3))
 #define PPC_RAW_LQARX(t, a, b, eh)	(0x7c000228 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | __PPC_EH(eh))
 #define PPC_RAW_LDARX(t, a, b, eh)	(0x7c0000a8 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | __PPC_EH(eh))
 #define PPC_RAW_LWARX(t, a, b, eh)	(0x7c000028 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | __PPC_EH(eh))
 #define PPC_RAW_PHWSYNC			(0x7c8004ac)
 #define PPC_RAW_PLWSYNC			(0x7ca004ac)
+#define PPC_RAW_STQ(t, a, ds)		(0xf8000002 | ___PPC_RT(t) | ___PPC_RA(a) | (((ds) & 0xfff) << 3))
 #define PPC_RAW_STQCX(t, a, b)		(0x7c00016d | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_RAW_MADDHD(t, a, b, c)	(0x10000030 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | ___PPC_RC(c))
 #define PPC_RAW_MADDHDU(t, a, b, c)	(0x10000031 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | ___PPC_RC(c))
@@ -530,9 +532,11 @@
 #define	PPC_DCBZL(a, b)		stringify_in_c(.long PPC_RAW_DCBZL(a, b))
 #define	PPC_DIVDE(t, a, b)	stringify_in_c(.long PPC_RAW_DIVDE(t, a, b))
 #define	PPC_DIVDEU(t, a, b)	stringify_in_c(.long PPC_RAW_DIVDEU(t, a, b))
+#define PPC_LQ(t, a, dq)	stringify_in_c(.long PPC_RAW_LQ(t, a, dq))
 #define PPC_LQARX(t, a, b, eh)	stringify_in_c(.long PPC_RAW_LQARX(t, a, b, eh))
 #define PPC_LDARX(t, a, b, eh)	stringify_in_c(.long PPC_RAW_LDARX(t, a, b, eh))
 #define PPC_LWARX(t, a, b, eh)	stringify_in_c(.long PPC_RAW_LWARX(t, a, b, eh))
+#define PPC_STQ(t, a, ds)	stringify_in_c(.long PPC_RAW_STQ(t, a, ds))
 #define PPC_STQCX(t, a, b)	stringify_in_c(.long PPC_RAW_STQCX(t, a, b))
 #define PPC_MADDHD(t, a, b, c)	stringify_in_c(.long PPC_RAW_MADDHD(t, a, b, c))
 #define PPC_MADDHDU(t, a, b, c)	stringify_in_c(.long PPC_RAW_MADDHDU(t, a, b, c))
diff --git a/arch/powerpc/lib/quad.S b/arch/powerpc/lib/quad.S
index da71760e50b5..de802a817992 100644
--- a/arch/powerpc/lib/quad.S
+++ b/arch/powerpc/lib/quad.S
@@ -15,7 +15,7 @@
 
 /* do_lq(unsigned long ea, unsigned long *regs) */
 _GLOBAL(do_lq)
-1:	lq	r6, 0(r3)
+1:	PPC_LQ(6, 3, 0)
 	std	r6, 0(r4)
 	std	r7, 8(r4)
 	li	r3, 0
@@ -26,7 +26,7 @@ _GLOBAL(do_lq)
 
 /* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */
 _GLOBAL(do_stq)
-1:	stq	r4, 0(r3)
+1:	PPC_STQ(4, 3, 0)
 	li	r3, 0
 	blr
 2:	li	r3, -EFAULT
-- 
2.27.0


  parent reply	other threads:[~2021-02-25  3:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  3:09 [RFC PATCH 0/8] WIP support for the LLVM integrated assembler Daniel Axtens
2021-02-25  3:09 ` [PATCH 1/8] powerpc/64s/exception: Clean up a missed SRR specifier Daniel Axtens
2021-02-25  3:10 ` [RFC PATCH 2/8] powerpc: check for support for -Wa,-m{power4,any} Daniel Axtens
2021-03-19  1:32   ` [RFC PATCH 2/8] powerpc: check for support for -Wa, -m{power4, any} Nicholas Piggin
2021-03-19 10:53     ` Michael Ellerman
2021-02-25  3:10 ` [RFC PATCH 3/8] powerpc/head-64: do less gas-specific stuff with sections Daniel Axtens
2021-03-19  1:35   ` Nicholas Piggin
2021-02-25  3:10 ` [RFC PATCH 4/8] powerpc/ppc_asm: use plain numbers for registers Daniel Axtens
2021-02-25 15:25   ` Segher Boessenkool
2021-02-26  0:12     ` Daniel Axtens
2021-03-19  1:39       ` Nicholas Piggin
2021-02-25  3:10 ` Daniel Axtens [this message]
2021-02-25 15:44   ` [RFC PATCH 5/8] poweprc/lib/quad: Provide macros for lq/stq Segher Boessenkool
2021-02-26  0:13     ` Daniel Axtens
2021-02-25  3:10 ` [RFC PATCH 6/8] powerpc/mm/book3s64/hash: drop pre 2.06 tlbiel for clang Daniel Axtens
2021-03-19  2:01   ` Nicholas Piggin
2021-03-22 16:49     ` Christophe Leroy
2021-03-22 18:11       ` Nicholas Piggin
2021-03-24 15:51         ` Segher Boessenkool
2021-03-24 21:07           ` Segher Boessenkool
2021-02-25  3:10 ` [RFC PATCH 7/8] powerpc/purgatory: drop .machine specifier Daniel Axtens
2021-02-25 15:58   ` Segher Boessenkool
2021-02-26  0:17     ` Daniel Axtens
2021-03-19  2:05     ` Nicholas Piggin
2021-03-19 10:59       ` Michael Ellerman
2021-02-25  3:10 ` [RFC PATCH 8/8] powerpc/64/asm: don't reassign labels Daniel Axtens
2021-02-25 16:08   ` Segher Boessenkool
2021-02-26  0:28     ` Daniel Axtens
2021-03-19  2:15       ` Nicholas Piggin
2021-03-14 10:01 ` [RFC PATCH 0/8] WIP support for the LLVM integrated assembler Michael Ellerman

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=20210225031006.1204774-6-dja@axtens.net \
    --to=dja@axtens.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvmlinux@lists.linuxfoundation.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.