|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions |
Date: | Thu, 24 Dec 2015 12:01:39 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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, address@hidden 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~
[Prev in Thread] | Current Thread | [Next in Thread] |