1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Floating-point, VMX/Altivec and VSX loads and stores
4 * for use in instruction emulation.
6 * Copyright 2010 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>
9 #include <asm/processor.h>
10 #include <asm/ppc_asm.h>
11 #include <asm/ppc-opcode.h>
13 #include <asm/asm-offsets.h>
14 #include <asm/asm-compat.h>
15 #include <linux/errno.h>
17 #define STKFRM (PPC_MIN_STKFRM + 16)
19 /* Get the contents of frN into *p; N is in r3 and p is in r4. */
43 /* Put the contents of *p into frN; N is in r3 and p is in r4. */
68 /* Get the contents of vrN into *p; N is in r3 and p is in r4. */
72 oris r7, r6, MSR_VEC@h
92 /* Put the contents of *p into vrN; N is in r3 and p is in r4. */
96 oris r7, r6, MSR_VEC@h
115 #endif /* CONFIG_ALTIVEC */
118 /* Get the contents of vsN into vs0; N is in r3. */
123 blr /* vs0 is already in vs0 */
137 /* Put the contents of vs0 into vsN; N is in r3. */
142 blr /* v0 is already in v0 */
156 /* Load VSX reg N from vector doubleword *p. N is in r3, p in r4. */
158 PPC_STLU r1,-STKFRM(r1)
160 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
170 #ifdef __LITTLE_ENDIAN__
176 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
183 /* Store VSX reg N to vector doubleword *p. N is in r3, p in r4. */
185 PPC_STLU r1,-STKFRM(r1)
187 PPC_STL r0,STKFRM+PPC_LR_STKOFF(r1)
195 #ifdef __LITTLE_ENDIAN__
200 PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1)
207 #endif /* CONFIG_VSX */
209 /* Convert single-precision to double, without disturbing FPRs. */
210 /* conv_sp_to_dp(float *sp, double *dp) */
211 _GLOBAL(conv_sp_to_dp)
224 /* Convert single-precision to double, without disturbing FPRs. */
225 /* conv_sp_to_dp(double *dp, float *sp) */
226 _GLOBAL(conv_dp_to_sp)