From nobody Sat Nov 1 08:18:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526337858862290.91718950350105; Mon, 14 May 2018 15:44:18 -0700 (PDT) Received: from localhost ([::1]:51044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIMCY-0001ln-5V for importer@patchew.org; Mon, 14 May 2018 18:44:18 -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) 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) 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-Google-Smtp-Source: AB8JxZrw6ghBtNYvhWRKwiVzbTfJBMsJsO6qqDd7Y8j1Tq3fwMba8iWVWanh3nExzsEjb5s5ijIZfA== X-Received: by 2002:a65:508d:: with SMTP id r13-v6mr10018768pgp.134.1526335978831; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Reduce the number of ifdefs. Correct the result for OpenRISC and TriCore (although TriCore fixed in target-specific code). Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- fpu/softfloat-specialize.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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 *sta= tus) uint64_t frac; =20 #if defined(TARGET_SPARC) || defined(TARGET_M68K) + /* !snan_bit_is_one, set all bits */ frac =3D (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 =3D 1ULL << (DECOMPOSED_BINARY_POINT - 1); + sign =3D 1; #elif defined(TARGET_HPPA) + /* snan_bit_is_one, set msb-1. */ frac =3D 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 =3D (1ULL << (DECOMPOSED_BINARY_POINT - 1)) - 1; } else { -#if defined(TARGET_MIPS) + /* set msb */ frac =3D 1ULL << (DECOMPOSED_BINARY_POINT - 1); -#else - frac =3D 1ULL << (DECOMPOSED_BINARY_POINT - 1); - sign =3D 1; -#endif } #endif =20 --=20 2.17.0