From patchwork Wed May 16 15:52:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 136043 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1145438lji; Wed, 16 May 2018 09:29:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoCNZP99jBDaei+eHjoSZq3TVWVUTihdvOAkwikKC0Wv7lnBnu5TDsqhE2xkf8OKx9NMpLP X-Received: by 2002:ac8:2237:: with SMTP id o52-v6mr1673329qto.355.1526488152949; Wed, 16 May 2018 09:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526488152; cv=none; d=google.com; s=arc-20160816; b=EIoaow3r2kasEdJSsUy5Lge2tSv70HnnMgO2sFP6qlsqKOT9Lst6qT59XuXTsIV+M8 9QQlW8zQSMiDfYcLs87XfCFmuXdPTJ84OuX7n6vBJSWNlbgrqC9q/Oww9U2GJC+E3Cbb HsS9J+P2G4LL/qVzuSgEygyZ5BHck4UptXjLr7TRgrl2LNf7nWvLROrx1laBxQqGbw0G FpBohHWkYM54KjY0mRqjsed9TVu1gmq1e/9XoGxy/VKVAEwBR4EVwLsAFjZJm/BOvgxV hU3PGPrqyF6SfTlRSfKASipLQAIs3nF9VpzLPQHuwFcg1pWsUUsCTmEt1NKZmEbbYxba rrXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=FoXwUVq86zr0ueZIYvuCk2E7EmzERIvaAi2zhHeG+WQ=; b=YxCS8PbVOnMlpjLZwdbjAY+8Qp357qQIub+cVtWu/RQtZp3EL/j54TUGu5HwttV/eV TnUw+4Qk8jv0OTkA8L4I41hWePL2j8N0u2WovUWjIsRe8cvkaJD/Ozu1Oym1tR8wlovm QJV6o+gv/yr2vPvZKOWnWstR36i+f1sJw9SR+7LkmleMzqe3YGkqzy6Uq3IrHSXP0cEB rFedt/cjRg6Hz2AmJ5jLLk4jdC1n4nLUMa1cd54LCfW1MQGrbw1sT1Z+tmgJW8q8rxDl T69O+qjIfgH1cVvq0cI1gFeLaZ+E7gMzX16tY41GQtAJcp+rMYBwWH7NBr2PZPwWh7N3 aqDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XnpDxK4d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o15-v6si3058137qvh.62.2018.05.16.09.29.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 09:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XnpDxK4d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIzIe-0007aW-Fi for patch@linaro.org; Wed, 16 May 2018 12:29:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIyk3-0004ix-45 for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIyk1-0005Bl-UN for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:27 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:34318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIyk1-0005BX-OJ for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:25 -0400 Received: by mail-pl0-x241.google.com with SMTP id ay10-v6so676886plb.1 for ; Wed, 16 May 2018 08:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FoXwUVq86zr0ueZIYvuCk2E7EmzERIvaAi2zhHeG+WQ=; b=XnpDxK4dmUOhs2rMTLWQ6D4nBc5TYceQCTYMePPFNBNxfL24UvKEfkzpw6vcwViMoT 9w34QG0/6oW4G7zWW14WWuYTYYJ4oxf/iyXQZ5VAtwIJ6cqeetNM3HrmK2pH433REVRy Y/0HWcmpQ4SBYjzhrv+6F5txbII/hukgoVBHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FoXwUVq86zr0ueZIYvuCk2E7EmzERIvaAi2zhHeG+WQ=; b=cCQESmI9yEnAQwTryYDq6rChEC4sXFBhcXWFyjqmtObPELBL/AJJruaEyAG8hfecUn MQmJsuhWV5KE+4V55j2KFgPyFNMnqFJSl7ci02wBaBwF0CzZpyuQm1v/kruXA76WB7Nh UMwgg1Xpa0GRxRrP83aG2ztqDPfDJa3/11fjKYkdmt5Cnxmh3FhGc/3Qf+3ih/pnBOYM 0e6FFutBKaWiDEFAmraUNvHrIZri0iA0765ISI1hCgvyCC4lPbl/37WOMAfmId3FGk6z sBp0ZfSBZUe/DcwgkfoH7x8naIWMxkQrBXiIiShTmuqvH8y3TUp7YYzndGZdSnXpM/6I 4y7Q== X-Gm-Message-State: ALKqPwek3zQoL2bBuOcoCqJk5Nx7WyfSvS/W92rmwHgkpoglCothF56T Zcm0hTfELXRzwYG463h5LBwPiba1hoQ= X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr1499732pls.270.1526486004312; Wed, 16 May 2018 08:53:24 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id c3-v6sm4966632pfn.62.2018.05.16.08.53.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 08:53:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 08:52:42 -0700 Message-Id: <20180516155243.16937-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516155243.16937-1-richard.henderson@linaro.org> References: <20180516155243.16937-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PULL 27/28] fpu/softfloat: Clean up parts_default_nan X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reduce the number of ifdefs. Correct the result for OpenRISC and TriCore (although TriCore fixed in target-specific code). Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- fpu/softfloat-specialize.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.17.0 diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 9d562ed504..ec4fb6ba8b 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -129,22 +129,29 @@ static FloatParts parts_default_nan(float_status *status) uint64_t frac; #if defined(TARGET_SPARC) || defined(TARGET_M68K) + /* !snan_bit_is_one, set all bits */ frac = (1ULL << DECOMPOSED_BINARY_POINT) - 1; -#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \ - defined(TARGET_S390X) || defined(TARGET_RISCV) +#elif defined(TARGET_I386) || defined(TARGET_X86_64) \ + || defined(TARGET_MICROBLAZE) + /* !snan_bit_is_one, set sign and msb */ frac = 1ULL << (DECOMPOSED_BINARY_POINT - 1); + sign = 1; #elif defined(TARGET_HPPA) + /* snan_bit_is_one, set msb-1. */ frac = 1ULL << (DECOMPOSED_BINARY_POINT - 2); #else + /* This case is true for Alpha, ARM, MIPS, OpenRISC, PPC, RISC-V, + * S390, SH4, TriCore, and Xtensa. I cannot find documentation + * for Unicore32; the choice from the original commit is unchanged. + * Our other supported targets, CRIS, LM32, Moxie, Nios2, and Tile, + * do not have floating-point. + */ if (snan_bit_is_one(status)) { + /* set all bits other than msb */ frac = (1ULL << (DECOMPOSED_BINARY_POINT - 1)) - 1; } else { -#if defined(TARGET_MIPS) + /* set msb */ frac = 1ULL << (DECOMPOSED_BINARY_POINT - 1); -#else - frac = 1ULL << (DECOMPOSED_BINARY_POINT - 1); - sign = 1; -#endif } #endif