From patchwork Mon May 14 22:12:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135792 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp209412lji; Mon, 14 May 2018 15:43:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpau5487+J4F+iPQqo3xdCozAcMW4XTjYPlfja5f242XyCMS0xtVYk3/YIC1/8nMG2Ap5WL X-Received: by 2002:aed:356a:: with SMTP id b39-v6mr10748836qte.230.1526337795745; Mon, 14 May 2018 15:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526337795; cv=none; d=google.com; s=arc-20160816; b=mWIL0qIwNeecuvNPmTpBzdxEOoOjlxDRDad/2OGKzPOnE3mYs/rqyrgNjp59256I+P +OzugQTW1KXGLA4G+guc1kqG9a0RQyr+5lpY6BYdntrJ9GL6gL4jnxFGXKxdYBVcqvbH ppTVLiV7bXiFjwVv3xIxpHkwP/mKhsD0X/7CQ8jf8rtC4lI0Ed7WGjcsxKcFVTvgCofS zrC3r/GqAFopAU6XOtcNN5xmEWGwvNsilpV/u7AzyRvdcLeBw6mj2KhmlmzMiTYxniqF AMxXCIebv8+zKCFLDpopQw+jek/o8mFfHmDQmjo4TGdnPXUollBOxBid4oUB0JB1Mr3M jcVw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=MmSgSLwT1JZjRsPCpF/ZgIgh9cLg8HFIxpF7qjon1YU=; b=IvymJ49EilB4SmV/IVWCdDRGXtvCk9k2VBZx4EKu1fhiXjEniPKq76xPoSPeQ5CDvo YQuJgkjKEICUV8LUO48LW+Ljp7FUzlNQy2aDN1MPz4wufHo/HvrDOtw4AMXdNjLn3QtL eUrmnqnQUtAcJk3cmHMABusuFE640nYME4fAadjkUqlIj9ICK5YPrTF6ih67yeJ0NpXM Zbl3o5T8HbmGM3OtJYmN3Z3MTm0RRlF/gW6FSzU8xlVprYt2kEasp32Ov2XXK3CxKxzT NkRKt6kJccpOt+tYRr2gYBREaoemDqTgRV8VirizU4FVNaLcSFEkEpbx95rTVw5VstLf b67Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QoxeagOy; 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 u32-v6si131302qth.34.2018.05.14.15.43.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 May 2018 15:43:15 -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=QoxeagOy; 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]:50957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIMBX-0000x1-3G for patch@linaro.org; Mon, 14 May 2018 18:43:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILiH-0008JU-G2 for qemu-devel@nongnu.org; Mon, 14 May 2018 18:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILiG-0000C8-8D for qemu-devel@nongnu.org; Mon, 14 May 2018 18:13:01 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:37436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILiG-0000AG-1r for qemu-devel@nongnu.org; Mon, 14 May 2018 18:13:00 -0400 Received: by mail-pf0-x241.google.com with SMTP id e9-v6so6669675pfi.4 for ; Mon, 14 May 2018 15:13:00 -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; bh=MmSgSLwT1JZjRsPCpF/ZgIgh9cLg8HFIxpF7qjon1YU=; b=QoxeagOy7NvXSOcgbeZjM6UqSXCzSETKqOrfTtlfIXXjDnXaGMgxX7Fmf7/prulULO ZSnMHHW1ij9QUNUkZioPDX0OcqJOFeZ7sfb/3HFY04PFKSWXMGi2VC5YVB5PT3Vu8ccC FTZ62O4uZpUJ8Mhx8q0ZnKVs9Dmp8Q72iFCag= 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; bh=MmSgSLwT1JZjRsPCpF/ZgIgh9cLg8HFIxpF7qjon1YU=; b=e6L0jlWWKaD++stN9wSJIgCmNzwWLQEwcO1JXxfvlXuuCmAkO4CZnqlpxKxvvwvAwh 8Tq3KibdSqZ4i6cSmmeXwINHpUFSC0MNgSaq04wXZ28CqFLhvezlpUISa7fZQBH5JYQI +sIsqk/MgO0MDjKrBhkCBgv7kKImNytPlLWgIu2JKKqRqsxqN8aKZSa/uiTLIK3fqNWV LoOXS9s463t+b3cSMpov+QEn9h5Q0w6YLiXsSE8bu+b1ZnH1KmZVEcT6LbwUY13F6hWP fHZEdDPB7+ctH5KzYs9Wchh8FwkFQfmGDNzNI3xf6Wtz0AgJLU/zIp0FQHtYoGDV/Vp5 RrIw== X-Gm-Message-State: ALKqPwfGg4iSx8ZJjvu5AEgIemCUnDQMHLU16e35wVeY9AfT5L/dGOv+ ydyQ8DjbSBjicnJlVIK3Hk0SKgiJWTI= X-Received: by 2002:a65:508d:: with SMTP id r13-v6mr10018768pgp.134.1526335978831; Mon, 14 May 2018 15:12:58 -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 y2-v6sm14512457pgp.92.2018.05.14.15.12.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:12:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:12:18 -0700 Message-Id: <20180514221219.7091-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514221219.7091-1-richard.henderson@linaro.org> References: <20180514221219.7091-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v5 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, alex.bennee@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). Signed-off-by: Richard Henderson --- fpu/softfloat-specialize.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) -- 2.17.0 Reviewed-by: Alex Bennée 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