2 * Floating-point, VMX/Altivec and VSX loads and stores
3 * for use in instruction emulation.
5 * Copyright 2010 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
13 #include <asm/processor.h>
14 #include <asm/ppc_asm.h>
15 #include <asm/ppc-opcode.h>
17 #include <asm/asm-offsets.h>
18 #include <linux/errno.h>
22 #define STKFRM (PPC_MIN_STKFRM + 16)
34 /* Get the contents of frN into fr0; N is in r3. */
39 blr /* fr0 is already in fr0 */
53 /* Put the contents of fr0 into frN; N is in r3. */
58 blr /* fr0 is already in fr0 */
72 /* Load FP reg N from float at *p. N is in r3, p in r4. */
74 PPC_STLU r1,-STKFRM(r1)
76 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
83 stfd fr0,STKFRM-16(r1)
90 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
99 /* Load FP reg N from double at *p. N is in r3, p in r4. */
101 PPC_STLU r1,-STKFRM(r1)
103 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
110 stfd fr0,STKFRM-16(r1)
116 lfd fr0,STKFRM-16(r1)
117 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
126 /* Store FP reg N to float at *p. N is in r3, p in r4. */
128 PPC_STLU r1,-STKFRM(r1)
130 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
137 stfd fr0,STKFRM-16(r1)
143 lfd fr0,STKFRM-16(r1)
144 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
153 /* Store FP reg N to double at *p. N is in r3, p in r4. */
155 PPC_STLU r1,-STKFRM(r1)
157 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
164 stfd fr0,STKFRM-16(r1)
170 lfd fr0,STKFRM-16(r1)
171 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
180 #ifdef CONFIG_ALTIVEC
181 /* Get the contents of vrN into v0; N is in r3. */
186 blr /* v0 is already in v0 */
190 vor v0,reg,reg /* assembler doesn't know vmr? */
200 /* Put the contents of v0 into vrN; N is in r3. */
205 blr /* v0 is already in v0 */
219 /* Load vector reg N from *p. N is in r3, p in r4. */
221 PPC_STLU r1,-STKFRM(r1)
223 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
238 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
247 /* Store vector reg N to *p. N is in r3, p in r4. */
249 PPC_STLU r1,-STKFRM(r1)
251 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
266 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
274 #endif /* CONFIG_ALTIVEC */
277 /* Get the contents of vsN into vs0; N is in r3. */
282 blr /* vs0 is already in vs0 */
296 /* Put the contents of vs0 into vsN; N is in r3. */
301 blr /* v0 is already in v0 */
315 /* Load VSX reg N from vector doubleword *p. N is in r3, p in r4. */
317 PPC_STLU r1,-STKFRM(r1)
319 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
334 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
343 /* Store VSX reg N to vector doubleword *p. N is in r3, p in r4. */
345 PPC_STLU r1,-STKFRM(r1)
347 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
362 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
371 #endif /* CONFIG_VSX */
373 #endif /* CONFIG_PPC_FPU */