arm/v7-a/fpu: add VFP-v3 D32 support

Change-Id: I1e59a191c8cb4ab2bf5527acf38bb65124275016
Signed-off-by: chao.an <anchao@xiaomi.com>
(cherry picked from commit 39351bc597e74088a27d9e0ab9df6fc8f2ad4347)
This commit is contained in:
chao.an
2021-04-22 16:08:08 +08:00
committed by 刘海涛
parent 32a2b4a7d3
commit 75dae70a6e
11 changed files with 94 additions and 4 deletions
+8
View File
@@ -789,6 +789,14 @@ config ARM_THUMB
default n
depends on ARCH_ARMV7A
config ARM_HAVE_FPU_D32
bool
select ARCH_HAVE_FPU
default n
---help---
FPU implemented in the VFPv3-D32 format that supports
32 double-precision floating-point registers.
config ARM_HAVE_MPU_UNIFIED
bool
default n
+23 -2
View File
@@ -151,8 +151,29 @@
# define REG_D15 (ARM_CONTEXT_REGS+30) /* D15 */
# define REG_S30 (ARM_CONTEXT_REGS+30) /* S30 */
# define REG_S31 (ARM_CONTEXT_REGS+31) /* S31 */
# define REG_FPSCR (ARM_CONTEXT_REGS+32) /* Floating point status and control */
# define FPU_CONTEXT_REGS (33)
# ifdef CONFIG_ARM_HAVE_FPU_D32
# define REG_D16 (ARM_CONTEXT_REGS+32) /* D16 */
# define REG_D17 (ARM_CONTEXT_REGS+34) /* D17 */
# define REG_D18 (ARM_CONTEXT_REGS+36) /* D18 */
# define REG_D19 (ARM_CONTEXT_REGS+38) /* D19 */
# define REG_D20 (ARM_CONTEXT_REGS+40) /* D20 */
# define REG_D21 (ARM_CONTEXT_REGS+42) /* D21 */
# define REG_D22 (ARM_CONTEXT_REGS+44) /* D22 */
# define REG_D23 (ARM_CONTEXT_REGS+46) /* D23 */
# define REG_D24 (ARM_CONTEXT_REGS+48) /* D24 */
# define REG_D25 (ARM_CONTEXT_REGS+50) /* D25 */
# define REG_D26 (ARM_CONTEXT_REGS+52) /* D26 */
# define REG_D27 (ARM_CONTEXT_REGS+54) /* D27 */
# define REG_D28 (ARM_CONTEXT_REGS+56) /* D28 */
# define REG_D29 (ARM_CONTEXT_REGS+58) /* D29 */
# define REG_D30 (ARM_CONTEXT_REGS+60) /* D30 */
# define REG_D31 (ARM_CONTEXT_REGS+62) /* D31 */
# define REG_FPSCR (ARM_CONTEXT_REGS+64) /* Floating point status and control */
# define FPU_CONTEXT_REGS (65)
# else
# define REG_FPSCR (ARM_CONTEXT_REGS+32) /* Floating point status and control */
# define FPU_CONTEXT_REGS (33)
# endif
#else
# define FPU_CONTEXT_REGS (0)
#endif
+23 -2
View File
@@ -151,8 +151,29 @@
# define REG_D15 (ARM_CONTEXT_REGS+30) /* D15 */
# define REG_S30 (ARM_CONTEXT_REGS+30) /* S30 */
# define REG_S31 (ARM_CONTEXT_REGS+31) /* S31 */
# define REG_FPSCR (ARM_CONTEXT_REGS+32) /* Floating point status and control */
# define FPU_CONTEXT_REGS (33)
# ifdef CONFIG_ARM_HAVE_FPU_D32
# define REG_D16 (ARM_CONTEXT_REGS+32) /* D16 */
# define REG_D17 (ARM_CONTEXT_REGS+34) /* D17 */
# define REG_D18 (ARM_CONTEXT_REGS+36) /* D18 */
# define REG_D19 (ARM_CONTEXT_REGS+38) /* D19 */
# define REG_D20 (ARM_CONTEXT_REGS+40) /* D20 */
# define REG_D21 (ARM_CONTEXT_REGS+42) /* D21 */
# define REG_D22 (ARM_CONTEXT_REGS+44) /* D22 */
# define REG_D23 (ARM_CONTEXT_REGS+46) /* D23 */
# define REG_D24 (ARM_CONTEXT_REGS+48) /* D24 */
# define REG_D25 (ARM_CONTEXT_REGS+50) /* D25 */
# define REG_D26 (ARM_CONTEXT_REGS+52) /* D26 */
# define REG_D27 (ARM_CONTEXT_REGS+54) /* D27 */
# define REG_D28 (ARM_CONTEXT_REGS+56) /* D28 */
# define REG_D29 (ARM_CONTEXT_REGS+58) /* D29 */
# define REG_D30 (ARM_CONTEXT_REGS+60) /* D30 */
# define REG_D31 (ARM_CONTEXT_REGS+62) /* D31 */
# define REG_FPSCR (ARM_CONTEXT_REGS+64) /* Floating point status and control */
# define FPU_CONTEXT_REGS (65)
# else
# define REG_FPSCR (ARM_CONTEXT_REGS+32) /* Floating point status and control */
# define FPU_CONTEXT_REGS (33)
# endif
#else
# define FPU_CONTEXT_REGS (0)
#endif
@@ -79,7 +79,12 @@ arm_fullcontextrestore:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vldmia.64 r1!, {d0-d15} /* Restore the full FP context */
vldmia.64 r1!, {d16-d31}
#else
vldmia r1!, {s0-s31} /* Restore the full FP context */
#endif
/* Load the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
+5
View File
@@ -72,7 +72,12 @@ arm_restorefpu:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vldmia.64 r1!, {d0-d15} /* Restore the full FP context */
vldmia.64 r1!, {d16-d31}
#else
vldmia r1!, {s0-s31} /* Restore the full FP context */
#endif
/* Load the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
+5
View File
@@ -76,7 +76,12 @@ arm_savefpu:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vstmia.64 r1!, {d0-d15} /* Save the full FP context */
vstmia.64 r1!, {d16-d31}
#else
vstmia r1!, {s0-s31} /* Save the full FP context */
#endif
/* Store the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
@@ -107,7 +107,12 @@ arm_saveusercontext:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vstmia.64 r1!, {d0-d15} /* Save the full FP context */
vstmia.64 r1!, {d16-d31}
#else
vstmia r1!, {s0-s31} /* Save the full FP context */
#endif
/* Store the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
@@ -83,7 +83,12 @@ arm_fullcontextrestore:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vldmia.64 r1!, {d0-d15} /* Restore the full FP context */
vldmia.64 r1!, {d16-d31}
#else
vldmia r1!, {s0-s31} /* Restore the full FP context */
#endif
/* Load the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
+5
View File
@@ -78,7 +78,12 @@ arm_restorefpu:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vldmia.64 r1!, {d0-d15} /* Restore the full FP context */
vldmia.64 r1!, {d16-d31}
#else
vldmia r1!, {s0-s31} /* Restore the full FP context */
#endif
/* Load the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
+5
View File
@@ -76,7 +76,12 @@ arm_savefpu:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vstmia.64 r1!, {d0-d15} /* Save the full FP context */
vstmia.64 r1!, {d16-d31}
#else
vstmia r1!, {s0-s31} /* Save the full FP context */
#endif
/* Store the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.
@@ -111,7 +111,12 @@ arm_saveusercontext:
* s0, s1, ... in increasing address order.
*/
#ifdef CONFIG_ARM_HAVE_FPU_D32
vstmia.64 r1!, {d0-d15} /* Save the full FP context */
vstmia.64 r1!, {d16-d31}
#else
vstmia r1!, {s0-s31} /* Save the full FP context */
#endif
/* Store the floating point control and status register. At the end of the
* vstmia, r1 will point to the FPCSR storage location.