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 @ Macros to allow building with old toolkits (with no VFP support)
12 .macro VFPFMRX, rd, sysreg, cond
13 MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg
16 .macro VFPFMXR, sysreg, rd, cond
17 MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd
20 @ read all the working registers back into the VFP
21 .macro VFPFLDMIA, base, tmp
23 #if __LINUX_ARM_ARCH__ < 6
24 fldmiax \base!, {d0-d15}
26 vldmia \base!, {d0-d15}
30 #if __LINUX_ARM_ARCH__ <= 6
31 ldr \tmp, =elf_hwcap @ may not have MVFR regs
33 tst \tmp, #HWCAP_VFPD32
34 vldmiane \base!, {d16-d31}
35 addeq \base, \base, #32*4 @ step over unused register space
37 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
38 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
39 cmp \tmp, #2 @ 32 x 64bit registers?
40 vldmiaeq \base!, {d16-d31}
41 addne \base, \base, #32*4 @ step over unused register space
46 @ write all the working registers out of the VFP
47 .macro VFPFSTMIA, base, tmp
48 #if __LINUX_ARM_ARCH__ < 6
49 fstmiax \base!, {d0-d15}
51 vstmia \base!, {d0-d15}
55 #if __LINUX_ARM_ARCH__ <= 6
56 ldr \tmp, =elf_hwcap @ may not have MVFR regs
58 tst \tmp, #HWCAP_VFPD32
59 vstmiane \base!, {d16-d31}
60 addeq \base, \base, #32*4 @ step over unused register space
62 VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
63 and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
64 cmp \tmp, #2 @ 32 x 64bit registers?
65 vstmiaeq \base!, {d16-d31}
66 addne \base, \base, #32*4 @ step over unused register space