From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCS0k-0006V2-2l for qemu-devel@nongnu.org; Fri, 25 Dec 2015 08:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCS0g-0008Jz-UD for qemu-devel@nongnu.org; Fri, 25 Dec 2015 08:02:22 -0500 Received: from out1134-201.mail.aliyun.com ([42.120.134.201]:3448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCS0g-0008J9-HW for qemu-devel@nongnu.org; Fri, 25 Dec 2015 08:02:18 -0500 Message-ID: <567D3F0A.6020809@emindsoft.com.cn> Date: Fri, 25 Dec 2015 21:05:14 +0800 From: Chen Gang MIME-Version: 1.0 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> <567C4F23.8090004@twiddle.net> In-Reply-To: <567C4F23.8090004@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Richard Henderson , peter.maydell@linaro.org, cmetcalf@ezchip.com Cc: qemu-devel@nongnu.org, 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