diff options
Diffstat (limited to 'arch/arm/include/asm/vfpmacros.h')
-rw-r--r-- | arch/arm/include/asm/vfpmacros.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h index 422f3cc204a2..3d5fc41ae8d3 100644 --- a/arch/arm/include/asm/vfpmacros.h +++ b/arch/arm/include/asm/vfpmacros.h | |||
@@ -3,6 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Assembler-only file containing VFP macros and register definitions. | 4 | * Assembler-only file containing VFP macros and register definitions. |
5 | */ | 5 | */ |
6 | #include <asm/hwcap.h> | ||
7 | |||
6 | #include "vfp.h" | 8 | #include "vfp.h" |
7 | 9 | ||
8 | @ Macros to allow building with old toolkits (with no VFP support) | 10 | @ Macros to allow building with old toolkits (with no VFP support) |
@@ -22,12 +24,20 @@ | |||
22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} | 24 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} |
23 | #endif | 25 | #endif |
24 | #ifdef CONFIG_VFPv3 | 26 | #ifdef CONFIG_VFPv3 |
27 | #if __LINUX_ARM_ARCH__ <= 6 | ||
28 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | ||
29 | ldr \tmp, [\tmp, #0] | ||
30 | tst \tmp, #HWCAP_VFPv3D16 | ||
31 | ldceq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | ||
32 | addne \base, \base, #32*4 @ step over unused register space | ||
33 | #else | ||
25 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | 34 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
26 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | 35 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
27 | cmp \tmp, #2 @ 32 x 64bit registers? | 36 | cmp \tmp, #2 @ 32 x 64bit registers? |
28 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | 37 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} |
29 | addne \base, \base, #32*4 @ step over unused register space | 38 | addne \base, \base, #32*4 @ step over unused register space |
30 | #endif | 39 | #endif |
40 | #endif | ||
31 | .endm | 41 | .endm |
32 | 42 | ||
33 | @ write all the working registers out of the VFP | 43 | @ write all the working registers out of the VFP |
@@ -38,10 +48,18 @@ | |||
38 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} | 48 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} |
39 | #endif | 49 | #endif |
40 | #ifdef CONFIG_VFPv3 | 50 | #ifdef CONFIG_VFPv3 |
51 | #if __LINUX_ARM_ARCH__ <= 6 | ||
52 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | ||
53 | ldr \tmp, [\tmp, #0] | ||
54 | tst \tmp, #HWCAP_VFPv3D16 | ||
55 | stceq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | ||
56 | addne \base, \base, #32*4 @ step over unused register space | ||
57 | #else | ||
41 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | 58 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
42 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | 59 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
43 | cmp \tmp, #2 @ 32 x 64bit registers? | 60 | cmp \tmp, #2 @ 32 x 64bit registers? |
44 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | 61 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} |
45 | addne \base, \base, #32*4 @ step over unused register space | 62 | addne \base, \base, #32*4 @ step over unused register space |
46 | #endif | 63 | #endif |
64 | #endif | ||
47 | .endm | 65 | .endm |