From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAWMe-0003tQ-VV for qemu-devel@nongnu.org; Sat, 08 Sep 2012 21:31:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAWMd-0003iW-UM for qemu-devel@nongnu.org; Sat, 08 Sep 2012 21:31:08 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:53999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAWMd-0003YP-Mz for qemu-devel@nongnu.org; Sat, 08 Sep 2012 21:31:07 -0400 Received: by mail-lb0-f173.google.com with SMTP id gm13so479700lbb.4 for ; Sat, 08 Sep 2012 18:31:07 -0700 (PDT) From: Max Filippov Date: Sun, 9 Sep 2012 05:29:52 +0400 Message-Id: <1347154198-8629-4-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1347154198-8629-1-git-send-email-jcmvbkbc@gmail.com> References: <1347154198-8629-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 3/9] target-xtensa: specialize softfloat NaN rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Max Filippov NaN propagation rule: leftmost NaN in the expression gets propagated to the result. Signed-off-by: Max Filippov --- fpu/softfloat-specialize.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 4902450..9d78f41 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -57,7 +57,8 @@ const float16 float16_default_nan = const_float16(0xFE00); *----------------------------------------------------------------------------*/ #if defined(TARGET_SPARC) const float32 float32_default_nan = const_float32(0x7FFFFFFF); -#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) +#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \ + defined(TARGET_XTENSA) const float32 float32_default_nan = const_float32(0x7FC00000); #elif SNAN_BIT_IS_ONE const float32 float32_default_nan = const_float32(0x7FBFFFFF); @@ -262,9 +263,13 @@ float32 float32_maybe_silence_nan( float32 a_ ) # error Rules for silencing a signaling NaN are target-specific # endif #else +# if defined(TARGET_XTENSA) + return a_; +# else uint32_t a = float32_val(a_); a |= (1 << 22); return make_float32(a); +# endif #endif } return a_; @@ -372,7 +377,7 @@ static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, return 1; } } -#elif defined(TARGET_PPC) +#elif defined(TARGET_PPC) || defined(TARGET_XTENSA) static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, flag aIsLargerSignificand) { -- 1.7.7.6