From nobody Mon Feb 9 23:40:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1566219985; cv=none; d=zoho.com; s=zohoarc; b=YSN+ko4TzqpYRBG+7Jwe6Mi1jz2sjn8vk8YDIphyjD4V8tg/K941gJFFa8kBzpv0FjZ0lEqp4BCpCSn7OcAtjWqShbtone4TeWEd9RCoUSNQvocVr0XTHyo1byxmO9ASZWz7AqZQJ+mtEXM/oxTttOEn+SN7Pe2nj3EVYSMQh90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566219985; h=Content-Type: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:ARC-Authentication-Results; bh=hF6p4Je/64/SW03Ma+K5ifIpi0u206rddvgWH5AsgEc=; b=jmq4lBP5gaNpGsqjBIAd03Js2BL6Xc7tVcB1NzEaeDSw5HwgkYB5wnyVpVA268jD1MNx5d52cjNQJsI4lW2iL7Ea+Zr1p4lr+sn/s/LgFutUKAIf2uqChzSMLijLSSI39B3E5OWD4yJaqDv99o6Jznac7ZS9tNNHjjtP6zX+r8A= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1566219985945299.6151094962522; Mon, 19 Aug 2019 06:06:25 -0700 (PDT) Received: from localhost ([::1]:50238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzhMe-0003qg-Cz for importer@patchew.org; Mon, 19 Aug 2019 09:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37940) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzgbO-0003B6-1q for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzgbG-0007Gi-Bm for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:28 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:32777) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzgbE-00078T-3F for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:24 -0400 Received: by mail-wr1-x435.google.com with SMTP id u16so8495576wrr.0 for ; Mon, 19 Aug 2019 05:17:14 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b136sm31322994wme.18.2019.08.19.05.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 05:17:11 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 45E2F1FF91; Mon, 19 Aug 2019 13:17:10 +0100 (BST) 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=hF6p4Je/64/SW03Ma+K5ifIpi0u206rddvgWH5AsgEc=; b=tzSxIQx95rUT08obl3j5xrdMYwqlTw5DrwxCH0miLmY2vw9SZV+xciCmM7M0s+QMyx ElZGZeCyvf5+7b11PAU8aKEIXqFQCvA9HnihPb2nl79vcPKIgOO2L9pp2ObfpvVDyQFL x5jqUfTH8nKHS5bL7Fd0iCE4jAq+8XHs9V5hbZm67tLiD67rlma5UAoKivOQTLOQmG65 JDL8v12DukuXWkdMsXz26CwxCdQhd+Hqk3FlNmH3UmGAW8XbI+YdM8cD0se/5l/7UtlP ghKRaoEF5tUB7FcYWY9qIjqQq9/RxiLqiemZXjFApRgwP79Pwr593Off+LrAJuqzt0f8 3fFQ== 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=hF6p4Je/64/SW03Ma+K5ifIpi0u206rddvgWH5AsgEc=; b=ktCJgmNbASrbhkL9jcQxearqzoThnFKKFCUIYeECAcuTGPYEBk2NuJnAlVGlsrWt1A OXiuP9JO7pTNv2vY1HFRNh+mAhUj6srHZKy+h2olissbwAuUIlpVv8Ue3Gpb77l8rvlU Fnla5qXV3Y63KtkXbF4wiA/6HVWvcJ+7JHBYaBDpblwiw0Fpu/qxnZ1H+tWF7yRa17jD VLv3gnIzWspRjAPQNXP3947Arhm5uTpwIqt0bbJmF/f3sFRwSIHpMusunMyKwQ7XjcTd kUEC7UXTrFaXpHroT1QFJdfLX+DyZ2SIOKgTQHfstzOzoiJmZ8y4YicQbBsSX4Otfowm ca4Q== X-Gm-Message-State: APjAAAX6bFaDOLznt1cs74NMpQDC6/ybQRJmBH86ElkumYTB7TY8TL2g 22RrodcLsOksWq6yvTB5YvwjkA== X-Google-Smtp-Source: APXvYqx3TOsIM+tFc75C+F9LWfPbiiCunZFD9TaLY273y1lIzcoao1r6uDIB+cLoFCt2uW9s6sKd1A== X-Received: by 2002:adf:8004:: with SMTP id 4mr19171042wrk.341.1566217033807; Mon, 19 Aug 2019 05:17:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 19 Aug 2019 13:17:01 +0100 Message-Id: <20190819121709.31597-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190819121709.31597-1-alex.bennee@linaro.org> References: <20190819121709.31597-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 Subject: [Qemu-devel] [PULL 04/12] fpu: replace LIT64 with UINT64_C macros 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: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In our quest to eliminate the home rolled LIT64 macro we fixup usage inside the softfloat code. While we are at it we remove some of the extraneous spaces to closer fit the house style. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson diff --git a/fpu/softfloat.c b/fpu/softfloat.c index d2cdf4a4a3b..7ef0638d7e4 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -447,7 +447,7 @@ static inline flag extractFloat32Sign(float32 a) =20 static inline uint64_t extractFloat64Frac(float64 a) { - return float64_val(a) & LIT64(0x000FFFFFFFFFFFFF); + return float64_val(a) & UINT64_C(0x000FFFFFFFFFFFFF); } =20 /*------------------------------------------------------------------------= ---- @@ -3251,7 +3251,7 @@ float128 float128_default_nan(float_status *status) */ r.low =3D -(p.frac & 1); r.high =3D p.frac >> (DECOMPOSED_BINARY_POINT - 48); - r.high |=3D LIT64(0x7FFF000000000000); + r.high |=3D UINT64_C(0x7FFF000000000000); r.high |=3D (uint64_t)p.sign << 63; =20 return r; @@ -3758,7 +3758,7 @@ static float64 roundAndPackFloat64(flag zSign, int zE= xp, uint64_t zSig, (status->float_detect_tininess =3D=3D float_tininess_before_rounding) || ( zExp < -1 ) - || ( zSig + roundIncrement < LIT64( 0x8000000000000000 ) ); + || ( zSig + roundIncrement < UINT64_C(0x8000000000000000) = ); shift64RightJamming( zSig, - zExp, &zSig ); zExp =3D 0; roundBits =3D zSig & 0x3FF; @@ -3858,12 +3858,12 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecis= ion, flag zSign, roundNearestEven =3D ( roundingMode =3D=3D float_round_nearest_even ); if ( roundingPrecision =3D=3D 80 ) goto precision80; if ( roundingPrecision =3D=3D 64 ) { - roundIncrement =3D LIT64( 0x0000000000000400 ); - roundMask =3D LIT64( 0x00000000000007FF ); + roundIncrement =3D UINT64_C(0x0000000000000400); + roundMask =3D UINT64_C(0x00000000000007FF); } else if ( roundingPrecision =3D=3D 32 ) { - roundIncrement =3D LIT64( 0x0000008000000000 ); - roundMask =3D LIT64( 0x000000FFFFFFFFFF ); + roundIncrement =3D UINT64_C(0x0000008000000000); + roundMask =3D UINT64_C(0x000000FFFFFFFFFF); } else { goto precision80; @@ -3927,7 +3927,7 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecisio= n, flag zSign, zSig0 +=3D roundIncrement; if ( zSig0 < roundIncrement ) { ++zExp; - zSig0 =3D LIT64( 0x8000000000000000 ); + zSig0 =3D UINT64_C(0x8000000000000000); } roundIncrement =3D roundMask + 1; if ( roundNearestEven && ( roundBits<<1 =3D=3D roundIncrement ) ) { @@ -3957,7 +3957,7 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecisio= n, flag zSign, if ( 0x7FFD <=3D (uint32_t) ( zExp - 1 ) ) { if ( ( 0x7FFE < zExp ) || ( ( zExp =3D=3D 0x7FFE ) - && ( zSig0 =3D=3D LIT64( 0xFFFFFFFFFFFFFFFF ) ) + && ( zSig0 =3D=3D UINT64_C(0xFFFFFFFFFFFFFFFF) ) && increment ) ) { @@ -3980,7 +3980,7 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecisio= n, flag zSign, =3D=3D float_tininess_before_rounding) || ( zExp < 0 ) || ! increment - || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); + || ( zSig0 < UINT64_C(0xFFFFFFFFFFFFFFFF) ); shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSi= g1 ); zExp =3D 0; if (isTiny && zSig1) { @@ -4022,7 +4022,7 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecisio= n, flag zSign, ++zSig0; if ( zSig0 =3D=3D 0 ) { ++zExp; - zSig0 =3D LIT64( 0x8000000000000000 ); + zSig0 =3D UINT64_C(0x8000000000000000); } else { zSig0 &=3D ~ ( ( (uint64_t) ( zSig1<<1 ) =3D=3D 0 ) & roundNea= restEven ); @@ -4084,7 +4084,7 @@ static inline uint64_t extractFloat128Frac1( float128= a ) static inline uint64_t extractFloat128Frac0( float128 a ) { =20 - return a.high & LIT64( 0x0000FFFFFFFFFFFF ); + return a.high & UINT64_C(0x0000FFFFFFFFFFFF); =20 } =20 @@ -4230,8 +4230,8 @@ static float128 roundAndPackFloat128(flag zSign, int3= 2_t zExp, if ( ( 0x7FFD < zExp ) || ( ( zExp =3D=3D 0x7FFD ) && eq128( - LIT64( 0x0001FFFFFFFFFFFF ), - LIT64( 0xFFFFFFFFFFFFFFFF ), + UINT64_C(0x0001FFFFFFFFFFFF), + UINT64_C(0xFFFFFFFFFFFFFFFF), zSig0, zSig1 ) @@ -4248,8 +4248,8 @@ static float128 roundAndPackFloat128(flag zSign, int3= 2_t zExp, packFloat128( zSign, 0x7FFE, - LIT64( 0x0000FFFFFFFFFFFF ), - LIT64( 0xFFFFFFFFFFFFFFFF ) + UINT64_C(0x0000FFFFFFFFFFFF), + UINT64_C(0xFFFFFFFFFFFFFFFF) ); } return packFloat128( zSign, 0x7FFF, 0, 0 ); @@ -4267,8 +4267,8 @@ static float128 roundAndPackFloat128(flag zSign, int3= 2_t zExp, || lt128( zSig0, zSig1, - LIT64( 0x0001FFFFFFFFFFFF ), - LIT64( 0xFFFFFFFFFFFFFFFF ) + UINT64_C(0x0001FFFFFFFFFFFF), + UINT64_C(0xFFFFFFFFFFFFFFFF) ); shift128ExtraRightJamming( zSig0, zSig1, zSig2, - zExp, &zSig0, &zSig1, &zSig2 ); @@ -5011,7 +5011,7 @@ floatx80 float64_to_floatx80(float64 a, float_status = *status) } return packFloatx80( - aSign, aExp + 0x3C00, ( aSig | LIT64( 0x0010000000000000 ) )<<= 11 ); + aSign, aExp + 0x3C00, (aSig | UINT64_C(0x0010000000000000)) <<= 11); =20 } =20 @@ -5095,8 +5095,8 @@ float64 float64_rem(float64 a, float64 b, float_statu= s *status) normalizeFloat64Subnormal( aSig, &aExp, &aSig ); } expDiff =3D aExp - bExp; - aSig =3D ( aSig | LIT64( 0x0010000000000000 ) )<<11; - bSig =3D ( bSig | LIT64( 0x0010000000000000 ) )<<11; + aSig =3D (aSig | UINT64_C(0x0010000000000000)) << 11; + bSig =3D (bSig | UINT64_C(0x0010000000000000)) << 11; if ( expDiff < 0 ) { if ( expDiff < -1 ) return a; aSig >>=3D 1; @@ -5169,13 +5169,13 @@ float64 float64_log2(float64 a, float_status *statu= s) } =20 aExp -=3D 0x3FF; - aSig |=3D LIT64( 0x0010000000000000 ); + aSig |=3D UINT64_C(0x0010000000000000); zSign =3D aExp < 0; zSig =3D (uint64_t)aExp << 52; for (i =3D 1LL << 51; i > 0; i >>=3D 1) { mul64To128( aSig, aSig, &aSig0, &aSig1 ); aSig =3D ( aSig0 << 12 ) | ( aSig1 >> 52 ); - if ( aSig & LIT64( 0x0020000000000000 ) ) { + if ( aSig & UINT64_C(0x0020000000000000) ) { aSig >>=3D 1; zSig |=3D i; } @@ -5555,7 +5555,7 @@ int64_t floatx80_to_int64_round_to_zero(floatx80 a, f= loat_status *status) aSign =3D extractFloatx80Sign( a ); shiftCount =3D aExp - 0x403E; if ( 0 <=3D shiftCount ) { - aSig &=3D LIT64( 0x7FFFFFFFFFFFFFFF ); + aSig &=3D UINT64_C(0x7FFFFFFFFFFFFFFF); if ( ( a.high !=3D 0xC03E ) || aSig ) { float_raise(float_flag_invalid, status); if ( ! aSign || ( ( aExp =3D=3D 0x7FFF ) && aSig ) ) { @@ -5724,23 +5724,23 @@ floatx80 floatx80_round_to_int(floatx80 a, float_st= atus *status) if ( ( aExp =3D=3D 0x3FFE ) && (uint64_t) ( extractFloatx80Fra= c( a )<<1 ) ) { return - packFloatx80( aSign, 0x3FFF, LIT64( 0x8000000000000000= ) ); + packFloatx80( aSign, 0x3FFF, UINT64_C(0x80000000000000= 00)); } break; case float_round_ties_away: if (aExp =3D=3D 0x3FFE) { - return packFloatx80(aSign, 0x3FFF, LIT64(0x800000000000000= 0)); + return packFloatx80(aSign, 0x3FFF, UINT64_C(0x800000000000= 0000)); } break; case float_round_down: return aSign ? - packFloatx80( 1, 0x3FFF, LIT64( 0x8000000000000000 )= ) + packFloatx80( 1, 0x3FFF, UINT64_C(0x8000000000000000= )) : packFloatx80( 0, 0, 0 ); case float_round_up: return aSign ? packFloatx80( 1, 0, 0 ) - : packFloatx80( 0, 0x3FFF, LIT64( 0x8000000000000000 ) ); + : packFloatx80( 0, 0x3FFF, UINT64_C(0x8000000000000000)); } return packFloatx80( aSign, 0, 0 ); } @@ -5776,7 +5776,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_stat= us *status) z.low &=3D ~ roundBitsMask; if ( z.low =3D=3D 0 ) { ++z.high; - z.low =3D LIT64( 0x8000000000000000 ); + z.low =3D UINT64_C(0x8000000000000000); } if (z.low !=3D a.low) { status->float_exception_flags |=3D float_flag_inexact; @@ -5849,7 +5849,7 @@ static floatx80 addFloatx80Sigs(floatx80 a, floatx80 = b, flag zSign, if ( (int64_t) zSig0 < 0 ) goto roundAndPack; shiftRight1: shift64ExtraRightJamming( zSig0, zSig1, 1, &zSig0, &zSig1 ); - zSig0 |=3D LIT64( 0x8000000000000000 ); + zSig0 |=3D UINT64_C(0x8000000000000000); ++zExp; roundAndPack: return roundAndPackFloatx80(status->floatx80_rounding_precision, @@ -6171,7 +6171,7 @@ floatx80 floatx80_rem(floatx80 a, floatx80 b, float_s= tatus *status) if ( (uint64_t) ( aSig0<<1 ) =3D=3D 0 ) return a; normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 ); } - bSig |=3D LIT64( 0x8000000000000000 ); + bSig |=3D UINT64_C(0x8000000000000000); zSign =3D aSign; expDiff =3D aExp - bExp; aSig1 =3D 0; @@ -6273,7 +6273,7 @@ floatx80 floatx80_sqrt(floatx80 a, float_status *stat= us) add128( rem0, rem1, zSig0>>63, doubleZSig0 | 1, &rem0, &rem1 ); } zSig1 =3D estimateDiv128To64( rem1, 0, doubleZSig0 ); - if ( ( zSig1 & LIT64( 0x3FFFFFFFFFFFFFFF ) ) <=3D 5 ) { + if ( ( zSig1 & UINT64_C(0x3FFFFFFFFFFFFFFF) ) <=3D 5 ) { if ( zSig1 =3D=3D 0 ) zSig1 =3D 1; mul64To128( doubleZSig0, zSig1, &term1, &term2 ); sub128( rem1, 0, term1, term2, &rem1, &rem2 ); @@ -6572,7 +6572,7 @@ int32_t float128_to_int32(float128 a, float_status *s= tatus) aExp =3D extractFloat128Exp( a ); aSign =3D extractFloat128Sign( a ); if ( ( aExp =3D=3D 0x7FFF ) && ( aSig0 | aSig1 ) ) aSign =3D 0; - if ( aExp ) aSig0 |=3D LIT64( 0x0001000000000000 ); + if ( aExp ) aSig0 |=3D UINT64_C(0x0001000000000000); aSig0 |=3D ( aSig1 !=3D 0 ); shiftCount =3D 0x4028 - aExp; if ( 0 < shiftCount ) shift64RightJamming( aSig0, shiftCount, &aSig0 ); @@ -6612,7 +6612,7 @@ int32_t float128_to_int32_round_to_zero(float128 a, f= loat_status *status) } return 0; } - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); shiftCount =3D 0x402F - aExp; savedASig =3D aSig0; aSig0 >>=3D shiftCount; @@ -6650,14 +6650,14 @@ int64_t float128_to_int64(float128 a, float_status = *status) aSig0 =3D extractFloat128Frac0( a ); aExp =3D extractFloat128Exp( a ); aSign =3D extractFloat128Sign( a ); - if ( aExp ) aSig0 |=3D LIT64( 0x0001000000000000 ); + if ( aExp ) aSig0 |=3D UINT64_C(0x0001000000000000); shiftCount =3D 0x402F - aExp; if ( shiftCount <=3D 0 ) { if ( 0x403E < aExp ) { float_raise(float_flag_invalid, status); if ( ! aSign || ( ( aExp =3D=3D 0x7FFF ) - && ( aSig1 || ( aSig0 !=3D LIT64( 0x0001000000000000= ) ) ) + && ( aSig1 || ( aSig0 !=3D UINT64_C(0x00010000000000= 00) ) ) ) ) { return INT64_MAX; @@ -6694,13 +6694,13 @@ int64_t float128_to_int64_round_to_zero(float128 a,= float_status *status) aSig0 =3D extractFloat128Frac0( a ); aExp =3D extractFloat128Exp( a ); aSign =3D extractFloat128Sign( a ); - if ( aExp ) aSig0 |=3D LIT64( 0x0001000000000000 ); + if ( aExp ) aSig0 |=3D UINT64_C(0x0001000000000000); shiftCount =3D aExp - 0x402F; if ( 0 < shiftCount ) { if ( 0x403E <=3D aExp ) { - aSig0 &=3D LIT64( 0x0000FFFFFFFFFFFF ); - if ( ( a.high =3D=3D LIT64( 0xC03E000000000000 ) ) - && ( aSig1 < LIT64( 0x0002000000000000 ) ) ) { + aSig0 &=3D UINT64_C(0x0000FFFFFFFFFFFF); + if ( ( a.high =3D=3D UINT64_C(0xC03E000000000000) ) + && ( aSig1 < UINT64_C(0x0002000000000000) ) ) { if (aSig1) { status->float_exception_flags |=3D float_flag_inexact; } @@ -6913,7 +6913,7 @@ float64 float128_to_float64(float128 a, float_status = *status) shortShift128Left( aSig0, aSig1, 14, &aSig0, &aSig1 ); aSig0 |=3D ( aSig1 !=3D 0 ); if ( aExp || aSig0 ) { - aSig0 |=3D LIT64( 0x4000000000000000 ); + aSig0 |=3D UINT64_C(0x4000000000000000); aExp -=3D 0x3C01; } return roundAndPackFloat64(aSign, aExp, aSig0, status); @@ -6949,7 +6949,7 @@ floatx80 float128_to_floatx80(float128 a, float_statu= s *status) normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); } else { - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); } shortShift128Left( aSig0, aSig1, 15, &aSig0, &aSig1 ); return roundAndPackFloatx80(80, aSign, aExp, aSig0, aSig1, status); @@ -7145,7 +7145,7 @@ static float128 addFloat128Sigs(float128 a, float128 = b, flag zSign, --expDiff; } else { - bSig0 |=3D LIT64( 0x0001000000000000 ); + bSig0 |=3D UINT64_C(0x0001000000000000); } shift128ExtraRightJamming( bSig0, bSig1, 0, expDiff, &bSig0, &bSig1, &zSig2 ); @@ -7162,7 +7162,7 @@ static float128 addFloat128Sigs(float128 a, float128 = b, flag zSign, ++expDiff; } else { - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); } shift128ExtraRightJamming( aSig0, aSig1, 0, - expDiff, &aSig0, &aSig1, &zSig2 ); @@ -7186,14 +7186,14 @@ static float128 addFloat128Sigs(float128 a, float12= 8 b, flag zSign, return packFloat128( zSign, 0, zSig0, zSig1 ); } zSig2 =3D 0; - zSig0 |=3D LIT64( 0x0002000000000000 ); + zSig0 |=3D UINT64_C(0x0002000000000000); zExp =3D aExp; goto shiftRight1; } - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 ); --zExp; - if ( zSig0 < LIT64( 0x0002000000000000 ) ) goto roundAndPack; + if ( zSig0 < UINT64_C(0x0002000000000000) ) goto roundAndPack; ++zExp; shiftRight1: shift128ExtraRightJamming( @@ -7257,10 +7257,10 @@ static float128 subFloat128Sigs(float128 a, float12= 8 b, flag zSign, ++expDiff; } else { - aSig0 |=3D LIT64( 0x4000000000000000 ); + aSig0 |=3D UINT64_C(0x4000000000000000); } shift128RightJamming( aSig0, aSig1, - expDiff, &aSig0, &aSig1 ); - bSig0 |=3D LIT64( 0x4000000000000000 ); + bSig0 |=3D UINT64_C(0x4000000000000000); bBigger: sub128( bSig0, bSig1, aSig0, aSig1, &zSig0, &zSig1 ); zExp =3D bExp; @@ -7277,10 +7277,10 @@ static float128 subFloat128Sigs(float128 a, float12= 8 b, flag zSign, --expDiff; } else { - bSig0 |=3D LIT64( 0x4000000000000000 ); + bSig0 |=3D UINT64_C(0x4000000000000000); } shift128RightJamming( bSig0, bSig1, expDiff, &bSig0, &bSig1 ); - aSig0 |=3D LIT64( 0x4000000000000000 ); + aSig0 |=3D UINT64_C(0x4000000000000000); aBigger: sub128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 ); zExp =3D aExp; @@ -7382,12 +7382,12 @@ float128 float128_mul(float128 a, float128 b, float= _status *status) normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 ); } zExp =3D aExp + bExp - 0x4000; - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); shortShift128Left( bSig0, bSig1, 16, &bSig0, &bSig1 ); mul128To256( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1, &zSig2, &zSig= 3 ); add128( zSig0, zSig1, aSig0, aSig1, &zSig0, &zSig1 ); zSig2 |=3D ( zSig3 !=3D 0 ); - if ( LIT64( 0x0002000000000000 ) <=3D zSig0 ) { + if (UINT64_C( 0x0002000000000000) <=3D zSig0 ) { shift128ExtraRightJamming( zSig0, zSig1, zSig2, 1, &zSig0, &zSig1, &zSig2 ); ++zExp; @@ -7454,9 +7454,9 @@ float128 float128_div(float128 a, float128 b, float_s= tatus *status) } zExp =3D aExp - bExp + 0x3FFD; shortShift128Left( - aSig0 | LIT64( 0x0001000000000000 ), aSig1, 15, &aSig0, &aSig1 ); + aSig0 | UINT64_C(0x0001000000000000), aSig1, 15, &aSig0, &aSig1 ); shortShift128Left( - bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 ); + bSig0 | UINT64_C(0x0001000000000000), bSig1, 15, &bSig0, &bSig1 ); if ( le128( bSig0, bSig1, aSig0, aSig1 ) ) { shift128Right( aSig0, aSig1, 1, &aSig0, &aSig1 ); ++zExp; @@ -7532,14 +7532,14 @@ float128 float128_rem(float128 a, float128 b, float= _status *status) expDiff =3D aExp - bExp; if ( expDiff < -1 ) return a; shortShift128Left( - aSig0 | LIT64( 0x0001000000000000 ), + aSig0 | UINT64_C(0x0001000000000000), aSig1, 15 - ( expDiff < 0 ), &aSig0, &aSig1 ); shortShift128Left( - bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 ); + bSig0 | UINT64_C(0x0001000000000000), bSig1, 15, &bSig0, &bSig1 ); q =3D le128( bSig0, bSig1, aSig0, aSig1 ); if ( q ) sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); expDiff -=3D 64; @@ -7625,7 +7625,7 @@ float128 float128_sqrt(float128 a, float_status *stat= us) normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 ); } zExp =3D ( ( aExp - 0x3FFF )>>1 ) + 0x3FFE; - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); zSig0 =3D estimateSqrt32( aExp, aSig0>>17 ); shortShift128Left( aSig0, aSig1, 13 - ( aExp & 1 ), &aSig0, &aSig1 ); zSig0 =3D estimateDiv128To64( aSig0, aSig1, zSig0<<32 ) + ( zSig0<<30 = ); @@ -8046,7 +8046,7 @@ float128 float128_scalbn(float128 a, int n, float_sta= tus *status) return a; } if (aExp !=3D 0) { - aSig0 |=3D LIT64( 0x0001000000000000 ); + aSig0 |=3D UINT64_C(0x0001000000000000); } else if (aSig0 =3D=3D 0 && aSig1 =3D=3D 0) { return a; } else { diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index be83a833ec9..3a956736742 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -618,13 +618,13 @@ static inline uint64_t estimateDiv128To64(uint64_t a0= , uint64_t a1, uint64_t b) uint64_t rem0, rem1, term0, term1; uint64_t z; =20 - if ( b <=3D a0 ) return LIT64( 0xFFFFFFFFFFFFFFFF ); + if ( b <=3D a0 ) return UINT64_C(0xFFFFFFFFFFFFFFFF); b0 =3D b>>32; - z =3D ( b0<<32 <=3D a0 ) ? LIT64( 0xFFFFFFFF00000000 ) : ( a0 / b0 )<<= 32; + z =3D ( b0<<32 <=3D a0 ) ? UINT64_C(0xFFFFFFFF00000000) : ( a0 / b0 )<= <32; mul64To128( b, z, &term0, &term1 ); sub128( a0, a1, term0, term1, &rem0, &rem1 ); while ( ( (int64_t) rem0 ) < 0 ) { - z -=3D LIT64( 0x100000000 ); + z -=3D UINT64_C(0x100000000); b1 =3D b<<32; add128( rem0, rem1, b0, b1, &rem0, &rem1 ); } --=20 2.20.1