mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
target/sparc: Introduce cpu_get_fsr, cpu_put_fsr
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20231103173841.33651-16-richard.henderson@linaro.org>
This commit is contained in:
parent
41535ca6f4
commit
1ccd6e13cc
9 changed files with 80 additions and 18 deletions
|
@ -347,10 +347,22 @@ GEN_FCMP(fcmpeq_fcc3, float128, 26, 1);
|
|||
#undef GEN_FCMP_T
|
||||
#undef GEN_FCMP
|
||||
|
||||
static void set_fsr(CPUSPARCState *env, target_ulong fsr)
|
||||
target_ulong cpu_get_fsr(CPUSPARCState *env)
|
||||
{
|
||||
return env->fsr;
|
||||
}
|
||||
|
||||
target_ulong helper_get_fsr(CPUSPARCState *env)
|
||||
{
|
||||
return cpu_get_fsr(env);
|
||||
}
|
||||
|
||||
static void set_fsr_nonsplit(CPUSPARCState *env, target_ulong fsr)
|
||||
{
|
||||
int rnd_mode;
|
||||
|
||||
env->fsr = fsr;
|
||||
|
||||
switch (fsr & FSR_RD_MASK) {
|
||||
case FSR_RD_NEAREST:
|
||||
rnd_mode = float_round_nearest_even;
|
||||
|
@ -369,7 +381,12 @@ static void set_fsr(CPUSPARCState *env, target_ulong fsr)
|
|||
set_float_rounding_mode(rnd_mode, &env->fp_status);
|
||||
}
|
||||
|
||||
void cpu_put_fsr(CPUSPARCState *env, target_ulong fsr)
|
||||
{
|
||||
set_fsr_nonsplit(env, fsr);
|
||||
}
|
||||
|
||||
void helper_set_fsr(CPUSPARCState *env, target_ulong fsr)
|
||||
{
|
||||
set_fsr(env, fsr);
|
||||
set_fsr_nonsplit(env, fsr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue