.. | .. |
---|
8 | 8 | |
---|
9 | 9 | #include <asm/vfp.h> |
---|
10 | 10 | |
---|
11 | | -@ Macros to allow building with old toolkits (with no VFP support) |
---|
| 11 | +#ifdef CONFIG_AS_VFP_VMRS_FPINST |
---|
| 12 | + .macro VFPFMRX, rd, sysreg, cond |
---|
| 13 | + vmrs\cond \rd, \sysreg |
---|
| 14 | + .endm |
---|
| 15 | + |
---|
| 16 | + .macro VFPFMXR, sysreg, rd, cond |
---|
| 17 | + vmsr\cond \sysreg, \rd |
---|
| 18 | + .endm |
---|
| 19 | +#else |
---|
| 20 | + @ Macros to allow building with old toolkits (with no VFP support) |
---|
12 | 21 | .macro VFPFMRX, rd, sysreg, cond |
---|
13 | 22 | MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg |
---|
14 | 23 | .endm |
---|
.. | .. |
---|
16 | 25 | .macro VFPFMXR, sysreg, rd, cond |
---|
17 | 26 | MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd |
---|
18 | 27 | .endm |
---|
| 28 | +#endif |
---|
19 | 29 | |
---|
20 | 30 | @ read all the working registers back into the VFP |
---|
21 | 31 | .macro VFPFLDMIA, base, tmp |
---|
| 32 | + .fpu vfpv2 |
---|
22 | 33 | #if __LINUX_ARM_ARCH__ < 6 |
---|
23 | | - LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} |
---|
| 34 | + fldmiax \base!, {d0-d15} |
---|
24 | 35 | #else |
---|
25 | | - LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} |
---|
| 36 | + vldmia \base!, {d0-d15} |
---|
26 | 37 | #endif |
---|
27 | 38 | #ifdef CONFIG_VFPv3 |
---|
| 39 | + .fpu vfpv3 |
---|
28 | 40 | #if __LINUX_ARM_ARCH__ <= 6 |
---|
29 | 41 | ldr \tmp, =elf_hwcap @ may not have MVFR regs |
---|
30 | 42 | ldr \tmp, [\tmp, #0] |
---|
31 | 43 | tst \tmp, #HWCAP_VFPD32 |
---|
32 | | - ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} |
---|
| 44 | + vldmiane \base!, {d16-d31} |
---|
33 | 45 | addeq \base, \base, #32*4 @ step over unused register space |
---|
34 | 46 | #else |
---|
35 | 47 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
---|
36 | 48 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
---|
37 | 49 | cmp \tmp, #2 @ 32 x 64bit registers? |
---|
38 | | - ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} |
---|
| 50 | + vldmiaeq \base!, {d16-d31} |
---|
39 | 51 | addne \base, \base, #32*4 @ step over unused register space |
---|
40 | 52 | #endif |
---|
41 | 53 | #endif |
---|
.. | .. |
---|
44 | 56 | @ write all the working registers out of the VFP |
---|
45 | 57 | .macro VFPFSTMIA, base, tmp |
---|
46 | 58 | #if __LINUX_ARM_ARCH__ < 6 |
---|
47 | | - STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} |
---|
| 59 | + fstmiax \base!, {d0-d15} |
---|
48 | 60 | #else |
---|
49 | | - STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} |
---|
| 61 | + vstmia \base!, {d0-d15} |
---|
50 | 62 | #endif |
---|
51 | 63 | #ifdef CONFIG_VFPv3 |
---|
| 64 | + .fpu vfpv3 |
---|
52 | 65 | #if __LINUX_ARM_ARCH__ <= 6 |
---|
53 | 66 | ldr \tmp, =elf_hwcap @ may not have MVFR regs |
---|
54 | 67 | ldr \tmp, [\tmp, #0] |
---|
55 | 68 | tst \tmp, #HWCAP_VFPD32 |
---|
56 | | - stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} |
---|
| 69 | + vstmiane \base!, {d16-d31} |
---|
57 | 70 | addeq \base, \base, #32*4 @ step over unused register space |
---|
58 | 71 | #else |
---|
59 | 72 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
---|
60 | 73 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
---|
61 | 74 | cmp \tmp, #2 @ 32 x 64bit registers? |
---|
62 | | - stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} |
---|
| 75 | + vstmiaeq \base!, {d16-d31} |
---|
63 | 76 | addne \base, \base, #32*4 @ step over unused register space |
---|
64 | 77 | #endif |
---|
65 | 78 | #endif |
---|