1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * FP/SIMD state saving and restoring
5 * Copyright (C) 2012 ARM Ltd.
6 * Author: Catalin Marinas <catalin.marinas@arm.com>
9 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/fpsimdmacros.h>
15 * Save the FP registers.
17 * x0 - pointer to struct fpsimd_state
19 SYM_FUNC_START(fpsimd_save_state)
22 SYM_FUNC_END(fpsimd_save_state)
25 * Load the FP registers.
27 * x0 - pointer to struct fpsimd_state
29 SYM_FUNC_START(fpsimd_load_state)
32 SYM_FUNC_END(fpsimd_load_state)
34 #ifdef CONFIG_ARM64_SVE
36 SYM_FUNC_START(sve_save_state)
39 SYM_FUNC_END(sve_save_state)
41 SYM_FUNC_START(sve_load_state)
42 sve_load 0, x1, x2, 3, x4
44 SYM_FUNC_END(sve_load_state)
46 SYM_FUNC_START(sve_get_vl)
49 SYM_FUNC_END(sve_get_vl)
51 SYM_FUNC_START(sve_set_vq)
52 sve_load_vq x0, x1, x2
54 SYM_FUNC_END(sve_set_vq)
57 * Load SVE state from FPSIMD state.
59 * x0 = pointer to struct fpsimd_state
62 * Each SVE vector will be loaded with the first 128-bits taken from FPSIMD
63 * and the rest zeroed. All the other SVE registers will be zeroed.
65 SYM_FUNC_START(sve_load_from_fpsimd_state)
66 sve_load_vq x1, x2, x3
68 _for n, 0, 15, _sve_pfalse \n
71 SYM_FUNC_END(sve_load_from_fpsimd_state)
73 /* Zero all SVE registers but the first 128-bits of each vector */
74 SYM_FUNC_START(sve_flush_live)
77 SYM_FUNC_END(sve_flush_live)
79 #endif /* CONFIG_ARM64_SVE */