mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
target/openrisc: Implement move to/from FPCSR
Reviewed-by: Stafford Horne <shorne@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2b13b4b93d
commit
a465772eea
5 changed files with 39 additions and 6 deletions
|
@ -61,6 +61,19 @@ void HELPER(update_fpcsr)(CPUOpenRISCState *env)
|
|||
}
|
||||
}
|
||||
|
||||
void cpu_set_fpcsr(CPUOpenRISCState *env, uint32_t val)
|
||||
{
|
||||
static const int rm_to_sf[] = {
|
||||
float_round_nearest_even,
|
||||
float_round_to_zero,
|
||||
float_round_up,
|
||||
float_round_down
|
||||
};
|
||||
|
||||
env->fpcsr = val & 0x7ff;
|
||||
set_float_rounding_mode(rm_to_sf[extract32(val, 1, 2)], &env->fp_status);
|
||||
}
|
||||
|
||||
uint64_t HELPER(itofd)(CPUOpenRISCState *env, uint64_t val)
|
||||
{
|
||||
return int64_to_float64(val, &env->fp_status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue