Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions

2015-12-25 Thread Chen Gang

On 12/25/15 04:01, Richard Henderson wrote:
> On 12/24/2015 07:38 AM, Chen Gang wrote:
>>
>> OK, thanks. Since fp_status need to be initialized to be 0, so I will
>> declared it statically, too (need we consider about thread safe for it?
>> I guess not).
> 
> While qemu is not currently thread-safe, there's work going on to make that 
> happen.  There is no need to exacerbate the problem.
> 

OK, thanks.

> Also, I think using an on-stack automatic variable, initialized each time, 
> emphasizes the fact there there is no state that is preserved across 
> operations.
> 
> This should really be as simple as
> 
>   float_status fp_status = {
> .float_rounding_mode = float_round_nearest_even
>   };
> 
> (I realize float_round_nearest_even is *also* zero, but humor me.  At least 
> the other members are either flags or booleans.)
> 

OK, thanks.

-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed



Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions

2015-12-24 Thread Richard Henderson

On 12/24/2015 07:38 AM, Chen Gang wrote:


On 12/24/15 06:51, Richard Henderson wrote:

On 12/23/2015 01:48 PM, cheng...@emindsoft.com.cn wrote:

+extern float_status fp_status;


No.  Locally declared in e.g. main_calc.



OK, thanks. Since fp_status need to be initialized to be 0, so I will
declared it statically, too (need we consider about thread safe for it?
I guess not).


While qemu is not currently thread-safe, there's work going on to make that 
happen.  There is no need to exacerbate the problem.


Also, I think using an on-stack automatic variable, initialized each time, 
emphasizes the fact there there is no state that is preserved across operations.


This should really be as simple as

  float_status fp_status = {
.float_rounding_mode = float_round_nearest_even
  };

(I realize float_round_nearest_even is *also* zero, but humor me.  At least the 
other members are either flags or booleans.)



r~



Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions

2015-12-24 Thread Chen Gang

On 12/24/15 06:51, Richard Henderson wrote:
> On 12/23/2015 01:48 PM, cheng...@emindsoft.com.cn wrote:
>> +extern float_status fp_status;
> 
> No.  Locally declared in e.g. main_calc.
> 

OK, thanks. Since fp_status need to be initialized to be 0, so I will
declared it statically, too (need we consider about thread safe for it?
I guess not).


Thanks.
-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed



Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions

2015-12-23 Thread Richard Henderson

On 12/23/2015 01:48 PM, cheng...@emindsoft.com.cn wrote:

+extern float_status fp_status;


No.  Locally declared in e.g. main_calc.


r~