From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCC56-0006xN-LC for qemu-devel@nongnu.org; Thu, 24 Dec 2015 15:01:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCC51-0004ZE-M9 for qemu-devel@nongnu.org; Thu, 24 Dec 2015 15:01:48 -0500 Received: from mail-qg0-x241.google.com ([2607:f8b0:400d:c04::241]:35653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCC51-0004Yz-Go for qemu-devel@nongnu.org; Thu, 24 Dec 2015 15:01:43 -0500 Received: by mail-qg0-x241.google.com with SMTP id b35so4022488qge.2 for ; Thu, 24 Dec 2015 12:01:43 -0800 (PST) Sender: Richard Henderson References: <1450907315-10135-1-git-send-email-chengang@emindsoft.com.cn> <1450907315-10135-2-git-send-email-chengang@emindsoft.com.cn> <567B2587.8060109@twiddle.net> <567C117D.9000900@emindsoft.com.cn> From: Richard Henderson Message-ID: <567C4F23.8090004@twiddle.net> Date: Thu, 24 Dec 2015 12:01:39 -0800 MIME-Version: 1.0 In-Reply-To: <567C117D.9000900@emindsoft.com.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/4] target-tilegx: Add floating point shared functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang , peter.maydell@linaro.org, cmetcalf@ezchip.com Cc: qemu-devel@nongnu.org, Chen Gang 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, chengang@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~