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~

Reply via email to