]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
4baa9922 | 2 | * arch/arm/include/asm/vfpmacros.h |
1da177e4 LT |
3 | * |
4 | * Assembler-only file containing VFP macros and register definitions. | |
5 | */ | |
5aaf2544 TL |
6 | #include <asm/hwcap.h> |
7 | ||
a1ce3928 | 8 | #include <asm/vfp.h> |
1da177e4 LT |
9 | |
10 | @ Macros to allow building with old toolkits (with no VFP support) | |
11 | .macro VFPFMRX, rd, sysreg, cond | |
12 | MRC\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMRX \rd, \sysreg | |
13 | .endm | |
14 | ||
15 | .macro VFPFMXR, sysreg, rd, cond | |
16 | MCR\cond p10, 7, \rd, \sysreg, cr0, 0 @ FMXR \sysreg, \rd | |
17 | .endm | |
18 | ||
19 | @ read all the working registers back into the VFP | |
25ebee02 | 20 | .macro VFPFLDMIA, base, tmp |
bb54a335 | 21 | #if __LINUX_ARM_ARCH__ < 6 |
1da177e4 | 22 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} |
bb54a335 CM |
23 | #else |
24 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} | |
25ebee02 CM |
25 | #endif |
26 | #ifdef CONFIG_VFPv3 | |
5aaf2544 TL |
27 | #if __LINUX_ARM_ARCH__ <= 6 |
28 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | |
29 | ldr \tmp, [\tmp, #0] | |
39141ddf PW |
30 | tst \tmp, #HWCAP_VFPD32 |
31 | ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | |
32 | addeq \base, \base, #32*4 @ step over unused register space | |
5aaf2544 | 33 | #else |
25ebee02 CM |
34 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
35 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | |
36 | cmp \tmp, #2 @ 32 x 64bit registers? | |
37 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | |
38 | addne \base, \base, #32*4 @ step over unused register space | |
5aaf2544 | 39 | #endif |
bb54a335 | 40 | #endif |
1da177e4 LT |
41 | .endm |
42 | ||
43 | @ write all the working registers out of the VFP | |
25ebee02 | 44 | .macro VFPFSTMIA, base, tmp |
bb54a335 | 45 | #if __LINUX_ARM_ARCH__ < 6 |
1da177e4 | 46 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} |
bb54a335 CM |
47 | #else |
48 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} | |
25ebee02 CM |
49 | #endif |
50 | #ifdef CONFIG_VFPv3 | |
5aaf2544 TL |
51 | #if __LINUX_ARM_ARCH__ <= 6 |
52 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | |
53 | ldr \tmp, [\tmp, #0] | |
39141ddf PW |
54 | tst \tmp, #HWCAP_VFPD32 |
55 | stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | |
56 | addeq \base, \base, #32*4 @ step over unused register space | |
5aaf2544 | 57 | #else |
25ebee02 CM |
58 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
59 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | |
60 | cmp \tmp, #2 @ 32 x 64bit registers? | |
61 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | |
62 | addne \base, \base, #32*4 @ step over unused register space | |
5aaf2544 | 63 | #endif |
bb54a335 | 64 | #endif |
1da177e4 | 65 | .endm |