summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/entry-fpsimd.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/kernel/entry-fpsimd.S')
-rw-r--r--arch/arm64/kernel/entry-fpsimd.S43
1 files changed, 3 insertions, 40 deletions
diff --git a/arch/arm64/kernel/entry-fpsimd.S b/arch/arm64/kernel/entry-fpsimd.S
index 17988a6e7ea..6a27cd6dbfa 100644
--- a/arch/arm64/kernel/entry-fpsimd.S
+++ b/arch/arm64/kernel/entry-fpsimd.S
@@ -20,6 +20,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
+#include <asm/fpsimdmacros.h>
/*
* Save the FP registers.
@@ -27,26 +28,7 @@
* x0 - pointer to struct fpsimd_state
*/
ENTRY(fpsimd_save_state)
- stp q0, q1, [x0, #16 * 0]
- stp q2, q3, [x0, #16 * 2]
- stp q4, q5, [x0, #16 * 4]
- stp q6, q7, [x0, #16 * 6]
- stp q8, q9, [x0, #16 * 8]
- stp q10, q11, [x0, #16 * 10]
- stp q12, q13, [x0, #16 * 12]
- stp q14, q15, [x0, #16 * 14]
- stp q16, q17, [x0, #16 * 16]
- stp q18, q19, [x0, #16 * 18]
- stp q20, q21, [x0, #16 * 20]
- stp q22, q23, [x0, #16 * 22]
- stp q24, q25, [x0, #16 * 24]
- stp q26, q27, [x0, #16 * 26]
- stp q28, q29, [x0, #16 * 28]
- stp q30, q31, [x0, #16 * 30]!
- mrs x8, fpsr
- str w8, [x0, #16 * 2]
- mrs x8, fpcr
- str w8, [x0, #16 * 2 + 4]
+ fpsimd_save x0, 8
ret
ENDPROC(fpsimd_save_state)
@@ -56,25 +38,6 @@ ENDPROC(fpsimd_save_state)
* x0 - pointer to struct fpsimd_state
*/
ENTRY(fpsimd_load_state)
- ldp q0, q1, [x0, #16 * 0]
- ldp q2, q3, [x0, #16 * 2]
- ldp q4, q5, [x0, #16 * 4]
- ldp q6, q7, [x0, #16 * 6]
- ldp q8, q9, [x0, #16 * 8]
- ldp q10, q11, [x0, #16 * 10]
- ldp q12, q13, [x0, #16 * 12]
- ldp q14, q15, [x0, #16 * 14]
- ldp q16, q17, [x0, #16 * 16]
- ldp q18, q19, [x0, #16 * 18]
- ldp q20, q21, [x0, #16 * 20]
- ldp q22, q23, [x0, #16 * 22]
- ldp q24, q25, [x0, #16 * 24]
- ldp q26, q27, [x0, #16 * 26]
- ldp q28, q29, [x0, #16 * 28]
- ldp q30, q31, [x0, #16 * 30]!
- ldr w8, [x0, #16 * 2]
- ldr w9, [x0, #16 * 2 + 4]
- msr fpsr, x8
- msr fpcr, x9
+ fpsimd_restore x0, 8
ret
ENDPROC(fpsimd_load_state)