aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2009-04-29 16:58:01 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-05-21 01:44:21 -0400
commitdfb432cb960bfcbdf668d0a228bc909897156b31 (patch)
tree535c3d956e4fd71047dfa5a85ee33aea3408b597 /arch
parentda6b43c833f885d8604aee7f9711bb457a40d863 (diff)
powerpc: Move VSX load/stores into ppc-opcode.h
Cleans up the VSX load/store instructions by moving them into ppc-opcode.h. Signed-off-by: Michael Neuling <mikey@neuling.org> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h13
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h10
2 files changed, 13 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 1c819501de22..39bcc9f9ff62 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -25,6 +25,7 @@
25#define PPC_INST_LSWI 0x7c0004aa 25#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a 26#define PPC_INST_LSWX 0x7c00042a
27#define PPC_INST_LWSYNC 0x7c2004ac 27#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_LXVD2X 0x7c000698
28#define PPC_INST_MCRXR 0x7c000400 29#define PPC_INST_MCRXR 0x7c000400
29#define PPC_INST_MCRXR_MASK 0xfc0007fe 30#define PPC_INST_MCRXR_MASK 0xfc0007fe
30#define PPC_INST_MFSPR_PVR 0x7c1f42a6 31#define PPC_INST_MFSPR_PVR 0x7c1f42a6
@@ -43,12 +44,14 @@
43 44
44#define PPC_INST_STSWI 0x7c0005aa 45#define PPC_INST_STSWI 0x7c0005aa
45#define PPC_INST_STSWX 0x7c00052a 46#define PPC_INST_STSWX 0x7c00052a
47#define PPC_INST_STXVD2X 0x7c000798
46#define PPC_INST_TLBILX 0x7c000024 48#define PPC_INST_TLBILX 0x7c000024
47#define PPC_INST_WAIT 0x7c00007c 49#define PPC_INST_WAIT 0x7c00007c
48 50
49/* macros to insert fields into opcodes */ 51/* macros to insert fields into opcodes */
50#define __PPC_RA(a) (((a) & 0x1f) << 16) 52#define __PPC_RA(a) (((a) & 0x1f) << 16)
51#define __PPC_RB(b) (((b) & 0x1f) << 11) 53#define __PPC_RB(b) (((b) & 0x1f) << 11)
54#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
52#define __PPC_T_TLB(t) (((t) & 0x3) << 21) 55#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
53#define __PPC_WC(w) (((w) & 0x3) << 21) 56#define __PPC_WC(w) (((w) & 0x3) << 21)
54 57
@@ -70,4 +73,14 @@
70#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ 73#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
71 __PPC_WC(w)) 74 __PPC_WC(w))
72 75
76/*
77 * Define what the VSX XX1 form instructions will look like, then add
78 * the 128 bit load store instructions based on that.
79 */
80#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
81#define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \
82 VSX_XX1((s), (a), (b)))
83#define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \
84 VSX_XX1((s), (a), (b)))
85
73#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 86#endif /* _ASM_POWERPC_PPC_OPCODE_H */
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 384d90c9c272..f9729529c20d 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -76,16 +76,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
76 REST_10GPRS(22, base) 76 REST_10GPRS(22, base)
77#endif 77#endif
78 78
79/*
80 * Define what the VSX XX1 form instructions will look like, then add
81 * the 128 bit load store instructions based on that.
82 */
83#define VSX_XX1(xs, ra, rb) (((xs) & 0x1f) << 21 | ((ra) << 16) | \
84 ((rb) << 11) | (((xs) >> 5)))
85
86#define STXVD2X(xs, ra, rb) .long (0x7c000798 | VSX_XX1((xs), (ra), (rb)))
87#define LXVD2X(xs, ra, rb) .long (0x7c000698 | VSX_XX1((xs), (ra), (rb)))
88
89#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) 79#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)
90#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) 80#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
91#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) 81#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)