target/arm: Move FPSCR get/set helpers to tcg/vfp_helper.c

Currently the helper_vfp_get_fpscr() and helper_vfp_set_fpscr()
functions do the actual work of updating the FPSCR, and we have
wrappers vfp_get_fpscr() and vfp_set_fpscr() which we use for calls
from other QEMU C code.

Flip these around so that it is vfp_get_fpscr() and vfp_set_fpscr()
which do the actual work, and helper_vfp_get_fpscr() and
helper_vfp_set_fpscr() which are the wrappers; this allows us to move
them to tcg/vfp_helper.c.

Since this is the last HELPER() we had in arm/vfp_helper.c, we can
drop the include of helper-proto.h.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250221190957.811948-3-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2025-02-21 19:09:54 +00:00
parent 1deb15c88a
commit e34cfba5e8
2 changed files with 12 additions and 13 deletions

View File

@ -1128,3 +1128,13 @@ void HELPER(check_hcr_el2_trap)(CPUARMState *env, uint32_t rt, uint32_t reg)
raise_exception(env, EXCP_HYP_TRAP, syndrome, 2); raise_exception(env, EXCP_HYP_TRAP, syndrome, 2);
} }
uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env)
{
return vfp_get_fpscr(env);
}
void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)
{
vfp_set_fpscr(env, val);
}

View File

@ -19,7 +19,6 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "cpu.h" #include "cpu.h"
#include "exec/helper-proto.h"
#include "internals.h" #include "internals.h"
#include "cpu-features.h" #include "cpu-features.h"
#include "fpu/softfloat.h" #include "fpu/softfloat.h"
@ -298,17 +297,12 @@ uint32_t vfp_get_fpsr(CPUARMState *env)
return fpsr; return fpsr;
} }
uint32_t HELPER(vfp_get_fpscr)(CPUARMState *env) uint32_t vfp_get_fpscr(CPUARMState *env)
{ {
return (vfp_get_fpcr(env) & FPSCR_FPCR_MASK) | return (vfp_get_fpcr(env) & FPSCR_FPCR_MASK) |
(vfp_get_fpsr(env) & FPSCR_FPSR_MASK); (vfp_get_fpsr(env) & FPSCR_FPSR_MASK);
} }
uint32_t vfp_get_fpscr(CPUARMState *env)
{
return HELPER(vfp_get_fpscr)(env);
}
void vfp_set_fpsr(CPUARMState *env, uint32_t val) void vfp_set_fpsr(CPUARMState *env, uint32_t val)
{ {
ARMCPU *cpu = env_archcpu(env); ARMCPU *cpu = env_archcpu(env);
@ -402,13 +396,8 @@ void vfp_set_fpcr(CPUARMState *env, uint32_t val)
vfp_set_fpcr_masked(env, val, MAKE_64BIT_MASK(0, 32)); vfp_set_fpcr_masked(env, val, MAKE_64BIT_MASK(0, 32));
} }
void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) void vfp_set_fpscr(CPUARMState *env, uint32_t val)
{ {
vfp_set_fpcr_masked(env, val, FPSCR_FPCR_MASK); vfp_set_fpcr_masked(env, val, FPSCR_FPCR_MASK);
vfp_set_fpsr(env, val & FPSCR_FPSR_MASK); vfp_set_fpsr(env, val & FPSCR_FPSR_MASK);
} }
void vfp_set_fpscr(CPUARMState *env, uint32_t val)
{
HELPER(vfp_set_fpscr)(env, val);
}