1 /* SPDX-License-Identifier: GPL-2.0 */
3 * arch/arm/include/asm/vfpmacros.h
5 * Assembler-only file containing VFP macros and register definitions.
11 #ifdef CONFIG_AS_VFP_VMRS_FPINST
12 .macro VFPFMRX, rd, sysreg, cond
13 vmrs\cond \rd, \sysreg
16 .macro VFPFMXR, sysreg, rd, cond
17 vmsr\cond \sysreg, \rd
20 @ Macros to allow building with old toolkits (with no VFP support)
21 .macro VFPFMRX, rd, sysreg, cond
22 MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg
25 .macro VFPFMXR, sysreg, rd, cond
26 MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd
30 @ read all the working registers back into the VFP
31 .macro VFPFLDMIA, base, tmp
33 #if __LINUX_ARM_ARCH__ < 6
34 fldmiax \base!, {d0-d15}
36 vldmia \base!, {d0-d15}
40 #if __LINUX_ARM_ARCH__ <= 6
41 ldr \tmp, =elf_hwcap @ may not have MVFR regs
43 tst \tmp, #HWCAP_VFPD32
44 vldmiane \base!, {d16-d31}
45 addeq \base, \base, #32*4 @ step over unused register space
47 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
48 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
49 cmp \tmp, #2 @ 32 x 64bit registers?
50 vldmiaeq \base!, {d16-d31}
51 addne \base, \base, #32*4 @ step over unused register space
56 @ write all the working registers out of the VFP
57 .macro VFPFSTMIA, base, tmp
58 #if __LINUX_ARM_ARCH__ < 6
59 fstmiax \base!, {d0-d15}
61 vstmia \base!, {d0-d15}
65 #if __LINUX_ARM_ARCH__ <= 6
66 ldr \tmp, =elf_hwcap @ may not have MVFR regs
68 tst \tmp, #HWCAP_VFPD32
69 vstmiane \base!, {d16-d31}
70 addeq \base, \base, #32*4 @ step over unused register space
72 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
73 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
74 cmp \tmp, #2 @ 32 x 64bit registers?
75 vstmiaeq \base!, {d16-d31}
76 addne \base, \base, #32*4 @ step over unused register space