mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
target-i386: fix helper_fscale() wrt softfloat
Use the scalbn softfloat function to implement helper_fscale(). This fixes corner cases (e.g. NaN) and makes a few more GNU libc math tests to pass. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
4cc5383f80
commit
be1c17c7fd
2 changed files with 10 additions and 1 deletions
|
@ -4174,7 +4174,12 @@ void helper_frndint(void)
|
|||
|
||||
void helper_fscale(void)
|
||||
{
|
||||
ST0 = ldexp (ST0, (int)(ST1));
|
||||
if (floatx_is_any_nan(ST1)) {
|
||||
ST0 = ST1;
|
||||
} else {
|
||||
int n = floatx_to_int32_round_to_zero(ST1, &env->fp_status);
|
||||
ST0 = floatx_scalbn(ST0, n, &env->fp_status);
|
||||
}
|
||||
}
|
||||
|
||||
void helper_fsin(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue