From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAga7-0000lg-Fr for qemu-devel@nongnu.org; Sun, 09 Sep 2012 08:25:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAga6-0000Ff-J2 for qemu-devel@nongnu.org; Sun, 09 Sep 2012 08:25:43 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:33189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAga6-0000Fb-Dr for qemu-devel@nongnu.org; Sun, 09 Sep 2012 08:25:42 -0400 Received: by obbta14 with SMTP id ta14so1538591obb.4 for ; Sun, 09 Sep 2012 05:25:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1347154198-8629-1-git-send-email-jcmvbkbc@gmail.com> <1347154198-8629-7-git-send-email-jcmvbkbc@gmail.com> Date: Sun, 9 Sep 2012 16:25:41 +0400 Message-ID: From: Max Filippov Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH 6/9] target-xtensa: implement FP0 arithmetic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Blue Swirl , qemu-devel@nongnu.org On Sun, Sep 9, 2012 at 2:05 PM, Peter Maydell wrote: > On 9 September 2012 02:29, Max Filippov wrote: >> +float32 HELPER(abs_s)(float32 v) >> +{ >> + return float32_abs(v); >> +} >> + >> +float32 HELPER(neg_s)(float32 v) >> +{ >> + return float32_chs(v); >> +} > > Given that these are just 'v &= 0x7fffffff' and 'v ^= 0x80000000' > it seems like it would be better to just generate code for them > rather than calling out to a helper, though in some ways it does > break the abstraction layer of the softfloat library. I've been > toying with the idea of doing this for target-arm. I doubt that these opcodes are used often enough to justify such hack. > (we could have gen_float32_abs() and gen_float32_chs() in > softfloat.h, or would that be a worse layering violation in > the other direction? I dunno.) IMHO this approach is a bit cleaner. -- Thanks. -- Max