From nobody Tue Feb 10 04:56:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620441177; cv=none; d=zohomail.com; s=zohoarc; b=FdQMPRtBTm/uXKNHQkFYclV+V2pDRuOXuM0jBi7XuSQwOxFXm94UaoGmRXQKzWkCmmQILKsl5cd7upPoOIfNnruInwEUm6y349kOlieMpLUXMg4265LXNQZIOPpDls0LQgrExZG+HCK75izJrKaVToDrHg8nYNnKdnxT713pHUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620441177; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j0n+VHMEDjMKtgDcOQxDeJHVUUgoF67rvW1U9FdzS+U=; b=PZsqGW9kKfpaaGn6bhRMbLg9Gu3mnfaWrmwBP4e0va+2ZYS4VyAgGnKmXm6m7nPGhtuCtzOrv4SFoXaXX0wcGB0TRY3L1qpyOzB2CkaSjizQIQfURLVCnG20j3Q2kCLV/+HvSG2d6I+epJS1Wn/sZbZ6dPmJY4fB9XoOyIiY3HY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620441177138137.79933221688975; Fri, 7 May 2021 19:32:57 -0700 (PDT) Received: from localhost ([::1]:51974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfCm0-0001t7-04 for importer@patchew.org; Fri, 07 May 2021 22:32:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfC8I-0003VH-NV for qemu-devel@nongnu.org; Fri, 07 May 2021 21:51:55 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:42837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfC8B-0005Zl-Jy for qemu-devel@nongnu.org; Fri, 07 May 2021 21:51:53 -0400 Received: by mail-pj1-x1029.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so6549244pjv.1 for ; Fri, 07 May 2021 18:51:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id 204sm5861396pfw.158.2021.05.07.18.51.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 18:51:45 -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=j0n+VHMEDjMKtgDcOQxDeJHVUUgoF67rvW1U9FdzS+U=; b=pYXZ4IdrMGqt3aSziGerRLzFWs/EfXAH5BATiLiNcsOB+JAdtmOZEbD585de7itdjf XdkxZM2Z2k4D+fkHrSNwva6D0N0N4ZbCDIUw/poCW3/9QET5ojznHR0VDrTbRDML1J32 lQfDVSEnr/Ye6bGTXp2kr1ogf9RK5KljE1FlT6xeMRHBuwDRVCyyjJ6uY9mYiH6Ylzsb okO26VP/6dERdhH8i09PVf51dT1jZm7UujiJXxR+/6jESA7//U/XsjAJAJBZk7+GeRUW rHGzmEz5thb1pvYGSV3Zmm7KFO0747tE4UMwREDZdFeDZ1IlQqiabeJFpOTealWH2eFA RRhA== 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=j0n+VHMEDjMKtgDcOQxDeJHVUUgoF67rvW1U9FdzS+U=; b=fGZwim5aUac0MTIXPz96MLhgk1ibtxSBXexbPxnEXbbhrHs9u7SfZLpb+KXZWDGeAf Ryt3cpSdT3RX4TKIaFHoeXkwwyBndmKHDXAItZUMus3DnSSMaHRb1TzSzh6m8TxIDrkk GBtyY5VKTaXoiu0kgDQFAlEDPDWM8Pf4/TybxlZJnShl8gBfvAYyxVMr7VAbNYaETESB oj4X+rSfF48JFNtzvFxVFYDQ5W+paQKyw4EqmRdLF7tu75bRYqfNF69jiAbcldY7Egp8 xUI7LvJvMA0SwptaD7WKChDa4T3wHRvvBLEDn8NKFiC0Y1OK+NNIlL1+vSiIR9GGkDnn 27rw== X-Gm-Message-State: AOAM532YslYT8FtwyP+yGn3Wq0977s9AtaHWFLLvqx6SGWU2kQxgSKpW VkkEfIds/ZIl/+0FldfUBAoNypoZCW2olQ== X-Google-Smtp-Source: ABdhPJx7FQyCmrNe1XaL7vIo1a88tzP66fj7Ae2drZoiMzmNs/gA6tPGYDfbzGWK30753RjvwpcsYg== X-Received: by 2002:a17:90a:be10:: with SMTP id a16mr25054610pjs.112.1620438705955; Fri, 07 May 2021 18:51:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 65/72] softfloat: Convert integer to floatx80 to FloatParts Date: Fri, 7 May 2021 18:47:55 -0700 Message-Id: <20210508014802.892561-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508014802.892561-1-richard.henderson@linaro.org> References: <20210508014802.892561-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- fpu/softfloat.c | 58 +++++++++++-------------------------------------- 1 file changed, 13 insertions(+), 45 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 914cf2688c..82f71896ac 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3344,6 +3344,19 @@ float128 int32_to_float128(int32_t a, float_status *= status) return int64_to_float128(a, status); } =20 +floatx80 int64_to_floatx80(int64_t a, float_status *status) +{ + FloatParts128 p; + + parts_sint_to_float(&p, a, 0, status); + return floatx80_round_pack_canonical(&p, status); +} + +floatx80 int32_to_floatx80(int32_t a, float_status *status) +{ + return int64_to_floatx80(a, status); +} + /* * Unsigned Integer to floating-point conversions */ @@ -5035,51 +5048,6 @@ static float128 normalizeRoundAndPackFloat128(bool z= Sign, int32_t zExp, =20 } =20 - -/*------------------------------------------------------------------------= ---- -| Returns the result of converting the 32-bit two's complement integer `a' -| to the extended double-precision floating-point format. The conversion -| is performed according to the IEC/IEEE Standard for Binary Floating-Point -| Arithmetic. -*-------------------------------------------------------------------------= ---*/ - -floatx80 int32_to_floatx80(int32_t a, float_status *status) -{ - bool zSign; - uint32_t absA; - int8_t shiftCount; - uint64_t zSig; - - if ( a =3D=3D 0 ) return packFloatx80( 0, 0, 0 ); - zSign =3D ( a < 0 ); - absA =3D zSign ? - a : a; - shiftCount =3D clz32(absA) + 32; - zSig =3D absA; - return packFloatx80( zSign, 0x403E - shiftCount, zSig<