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 <asm/asm-compat.h>
19 #include <linux/errno.h>
23 #define STKFRM (PPC_MIN_STKFRM + 16)
25 /* Get the contents of frN into *p; N is in r3 and p is in r4. */
49 /* Put the contents of *p into frN; N is in r3 and p is in r4. */
74 /* Get the contents of vrN into *p; N is in r3 and p is in r4. */
78 oris r7, r6, MSR_VEC@h
98 /* Put the contents of *p into vrN; N is in r3 and p is in r4. */
102 oris r7, r6, MSR_VEC@h
121 #endif /* CONFIG_ALTIVEC */
124 /* Get the contents of vsN into vs0; N is in r3. */
129 blr /* vs0 is already in vs0 */
143 /* Put the contents of vs0 into vsN; N is in r3. */
148 blr /* v0 is already in v0 */
162 /* Load VSX reg N from vector doubleword *p. N is in r3, p in r4. */
164 PPC_STLU r1,-STKFRM(r1)
166 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
176 #ifdef __LITTLE_ENDIAN__
182 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
189 /* Store VSX reg N to vector doubleword *p. N is in r3, p in r4. */
191 PPC_STLU r1,-STKFRM(r1)
193 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
201 #ifdef __LITTLE_ENDIAN__
206 PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
213 #endif /* CONFIG_VSX */
215 /* Convert single-precision to double, without disturbing FPRs. */
216 /* conv_sp_to_dp(float *sp, double *dp) */
217 _GLOBAL(conv_sp_to_dp)
230 /* Convert single-precision to double, without disturbing FPRs. */
231 /* conv_sp_to_dp(double *dp, float *sp) */
232 _GLOBAL(conv_dp_to_sp)
245 #endif /* CONFIG_PPC_FPU */