Patchwork alpha-user: Initialize FPCR with round-to-nearest.

login
register
mail settings
Submitter Richard Henderson
Date March 11, 2012, 6:54 p.m.
Message ID <1331492067-32266-1-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/146000/
State New
Headers show

Comments

Richard Henderson - March 11, 2012, 6:54 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-alpha/translate.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Richard Henderson - March 17, 2012, 7:30 p.m.
Ping.

On 03/11/2012 11:54 AM, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  target-alpha/translate.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index 1d2142b..fe78630 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -3513,7 +3513,8 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
>  #if defined (CONFIG_USER_ONLY)
>      env->ps = PS_USER_MODE;
>      cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
> -                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
> +                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD
> +                               | FPCR_DYN_NORMAL));
>  #endif
>      env->lock_addr = -1;
>      env->fen = 1;
Andreas Färber - March 19, 2012, 11:01 a.m.
Am 17.03.2012 20:30, schrieb Richard Henderson:
> Ping.

This is linux-user, so cc'ing Riku.

Code looks sane at first sight although I have no clue of the constants'
meaning and effect. ;)

Commit message doesn't mention it but I guess this fixes some bug? How
does it round before the patch?

Andreas

> 
> On 03/11/2012 11:54 AM, Richard Henderson wrote:
>> Signed-off-by: Richard Henderson <rth@twiddle.net>
>> ---
>>  target-alpha/translate.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
>> index 1d2142b..fe78630 100644
>> --- a/target-alpha/translate.c
>> +++ b/target-alpha/translate.c
>> @@ -3513,7 +3513,8 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
>>  #if defined (CONFIG_USER_ONLY)
>>      env->ps = PS_USER_MODE;
>>      cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
>> -                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
>> +                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD
>> +                               | FPCR_DYN_NORMAL));
>>  #endif
>>      env->lock_addr = -1;
>>      env->fen = 1;
Richard Henderson - March 19, 2012, 1:32 p.m.
On 03/19/12 04:01, Andreas Färber wrote:
> Am 17.03.2012 20:30, schrieb Richard Henderson:
>> Ping.
> 
> This is linux-user, so cc'ing Riku.
> 
> Code looks sane at first sight although I have no clue of the constants'
> meaning and effect. ;)
> 
> Commit message doesn't mention it but I guess this fixes some bug? How
> does it round before the patch?

It does round-to-zero before the patch.

r~

Patch

diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 1d2142b..fe78630 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -3513,7 +3513,8 @@  CPUAlphaState * cpu_alpha_init (const char *cpu_model)
 #if defined (CONFIG_USER_ONLY)
     env->ps = PS_USER_MODE;
     cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
-                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
+                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD
+                               | FPCR_DYN_NORMAL));
 #endif
     env->lock_addr = -1;
     env->fen = 1;