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)
24 /* Get the contents of frN into *p; N is in r3 and p is in r4. */
48 /* Put the contents of *p into frN; N is in r3 and p is in r4. */
73 /* Get the contents of vrN into *p; N is in r3 and p is in r4. */
77 oris r7, r6, MSR_VEC@h
97 /* Put the contents of *p into vrN; N is in r3 and p is in r4. */
101 oris r7, r6, MSR_VEC@h
120 #endif /* CONFIG_ALTIVEC */
123 /* Get the contents of vsN into vs0; N is in r3. */
128 blr /* vs0 is already in vs0 */
142 /* Put the contents of vs0 into vsN; N is in r3. */
147 blr /* v0 is already in v0 */
161 /* Load VSX reg N from vector doubleword *p. N is in r3, p in r4. */
163 PPC_STLU r1,-STKFRM(r1)
165 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
175 #ifdef __LITTLE_ENDIAN__
181 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
188 /* Store VSX reg N to vector doubleword *p. N is in r3, p in r4. */
190 PPC_STLU r1,-STKFRM(r1)
192 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
200 #ifdef __LITTLE_ENDIAN__
205 PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
212 #endif /* CONFIG_VSX */
214 /* Convert single-precision to double, without disturbing FPRs. */
215 /* conv_sp_to_dp(float *sp, double *dp) */
216 _GLOBAL(conv_sp_to_dp)
229 /* Convert single-precision to double, without disturbing FPRs. */
230 /* conv_sp_to_dp(double *dp, float *sp) */
231 _GLOBAL(conv_dp_to_sp)
244 #endif /* CONFIG_PPC_FPU */