From patchwork Mon Aug 19 12:16:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 171614 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2940902ily; Mon, 19 Aug 2019 05:57:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpn83KmFSDb7MpIeEun041EtNOVisPwL9tLbWL61zisZzKjJerXgOcQ2Eds9qZJQkMv6Lv X-Received: by 2002:a17:906:b7c9:: with SMTP id fy9mr20268600ejb.237.1566219435611; Mon, 19 Aug 2019 05:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566219435; cv=none; d=google.com; s=arc-20160816; b=rpQTPmMwgSC2vszWszfE3ZeUXVj4MfaBNE+iA+bffuBhAhTQ/1TEJ+dDB3q9kYbzek rC6nTo3lyU5wMSC2Zwm/71+jKnf0C4bMVFRtSIDUazfBAt1D9WtaizAlo7LQP9b2EJ+c VDjXM1jPG/J6jbIOPBEuYJJJJ3KvckvQ0sbZtCQxJ7e1srI8lZAlxH4vOQ3qfpVMAxyo 2izOLfjGh9NkFGXLeE4EkqOofxLg/Fn0a+vswllaAlGkSfLDGxWiLkBKp8uEjnBrKaUY yDWVUUdV4+zoFMuzmWaZPcJlEES0/2ZHS8SC/uyyrXYjTc4K2PDSFLOWX6evS0Kj866n 2oIA== 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; bh=x7wHfawCjsVF1Gi5t5yCk6URAAid1imk9lHZgcaTxXU=; b=ZJu0qN/0GBwx2tTaJvreRlRkRwvHpUgtZoGKblMJe3ifpVvsfUnwUPH/D3X6Z0WNw7 nrfAuKZ3ivs9ESLPHDffkfZRSU/DbzsBbxVc8qQIYtNzTvT3derZZXeOYcPWSFhqPf5N K+4YCJDBj6+yOEB2OgFh6kcmowUhH8WFdHE7BMkYXZ4hv1o6JuGjSZiyRWfzdGgvn8gQ WArd7IjaZXy3OrJmHQ8RO0y3DH2NvXFNrc7lav4APYQsjbxc5oqFMhoWoLVJHSTwXJTQ GjqQVLVMabY0kcaWmBrenJVcH0YvUwf3L8Oy4PPByjYPSf/ekB0tMQaGQn+J3uf2jWSG xJuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dphg+eyp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id jo15si7096861ejb.93.2019.08.19.05.57.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 05:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dphg+eyp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:49732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzhDl-0001VI-Tb for patch@linaro.org; Mon, 19 Aug 2019 08:57:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37859) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzgbG-00038D-JB for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzgbE-0007EB-2f for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:26 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:40661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzgb6-00077J-L7 for qemu-devel@nongnu.org; Mon, 19 Aug 2019 08:17:19 -0400 Received: by mail-wr1-x42a.google.com with SMTP id c3so8493872wrd.7 for ; Mon, 19 Aug 2019 05:17:12 -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=x7wHfawCjsVF1Gi5t5yCk6URAAid1imk9lHZgcaTxXU=; b=Dphg+eyp48GJg2nJCUQ4FgjBFs4pMDSr2w9yKHXJIyfMhDyJSSbXFtRbx9MXxAvsPf alVSPsdTPcmJghhKl8/bFjBNS3j0SxZOUyIhfrQQ3Ud+MiehFTZorQDTdlzuZY3ETZiA Zp8KzLqrlROQR4ETFcJ1pxeumRQJdrUneckg+RMDtV4V9hbB90CTQcvimn2/HUk5itxR MCy8iQ11all9dwtcDmCNdwJbfr20HKh2hHRckl95Sx3Z1XXXyTlTmXPq7SOiyeJxpZt/ uQV3nfXjVcNqOZcjww5EDZPmAcW+BrDGHQXGcDA4YHIm9mLyddLsoJ7XqrcMnu7f6hsw 0dGw== 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=x7wHfawCjsVF1Gi5t5yCk6URAAid1imk9lHZgcaTxXU=; b=nRmbj1afP03A9xSgLaGk44AzqEhzWFEJ33qY3DyGoD+4NJvBLldj39BCVvVsFSAp8W JkgxMtHuGrPLV/Vi9GWIhBrNUrI7iBHR+rerUAGQ+deAs/9y/Rv7IVuCUPzeSTNSdnat V6hcul/srGdEfiUsQLrQ8herD0fPG+C3fMH9aUgAkStPb2LX3kMRufpcNgmxoHm1VUQD IcOVvatS81NJfAsWuZWI6TbwDCQQ3MKQMHSBHZYG4BOKXr5FgJviYLTeb4fDVK4NQrd3 nrMo3YptKwlP3JIfJk74zIHcQsi8OrsBg6eQwnthYejvPjogIufKTuolsNbILNlUFcHA eafQ== X-Gm-Message-State: APjAAAWcAauhbxEVCXOKQNCz3LlKir60/+XznSemXZw/aC2WW/IysAc1 pH4suSBaXPvUIy0G/5bIUJHQ2w== X-Received: by 2002:adf:fdcc:: with SMTP id i12mr28155918wrs.88.1566217031406; Mon, 19 Aug 2019 05:17:11 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h9sm12348347wrt.53.2019.08.19.05.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 05:17:10 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 04EE31FF8C; Mon, 19 Aug 2019 13:17:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 19 Aug 2019 13:16:58 +0100 Message-Id: <20190819121709.31597-2-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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a Subject: [Qemu-devel] [PULL 01/12] fpu: replace LIT64 usage with UINT64_C for specialize constants 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_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have a wrapper that does the right thing from stdint.h so lets use it for our constants in softfloat-specialize.h Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 7b8895726c5..5ab2fa19415 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -196,11 +196,11 @@ floatx80 floatx80_default_nan(float_status *status) /* None of the targets that have snan_bit_is_one use floatx80. */ assert(!snan_bit_is_one(status)); #if defined(TARGET_M68K) - r.low = LIT64(0xFFFFFFFFFFFFFFFF); + r.low = UINT64_C(0xFFFFFFFFFFFFFFFF); r.high = 0x7FFF; #else /* X86 */ - r.low = LIT64(0xC000000000000000); + r.low = UINT64_C(0xC000000000000000); r.high = 0xFFFF; #endif return r; @@ -212,9 +212,9 @@ floatx80 floatx80_default_nan(float_status *status) #define floatx80_infinity_high 0x7FFF #if defined(TARGET_M68K) -#define floatx80_infinity_low LIT64(0x0000000000000000) +#define floatx80_infinity_low UINT64_C(0x0000000000000000) #else -#define floatx80_infinity_low LIT64(0x8000000000000000) +#define floatx80_infinity_low UINT64_C(0x8000000000000000) #endif const floatx80 floatx80_infinity @@ -667,7 +667,7 @@ int float64_is_signaling_nan(float64 a_, float_status *status) return ((a << 1) >= 0xFFF0000000000000ULL); } else { return (((a >> 51) & 0xFFF) == 0xFFE) - && (a & LIT64(0x0007FFFFFFFFFFFF)); + && (a & UINT64_C(0x0007FFFFFFFFFFFF)); } #endif } @@ -707,7 +707,7 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status) if (mantissa) { return make_float64( (((uint64_t) a.sign) << 63) - | LIT64(0x7FF0000000000000) + | UINT64_C(0x7FF0000000000000) | (a.high >> 12)); } else { return float64_default_nan(status); @@ -790,7 +790,7 @@ int floatx80_is_quiet_nan(floatx80 a, float_status *status) && (a.low == aLow); } else { return ((a.high & 0x7FFF) == 0x7FFF) - && (LIT64(0x8000000000000000) <= ((uint64_t)(a.low << 1))); + && (UINT64_C(0x8000000000000000) <= ((uint64_t)(a.low << 1))); } #endif } @@ -812,7 +812,7 @@ int floatx80_is_signaling_nan(floatx80 a, float_status *status) } else { uint64_t aLow; - aLow = a.low & ~LIT64(0x4000000000000000); + aLow = a.low & ~UINT64_C(0x4000000000000000); return ((a.high & 0x7FFF) == 0x7FFF) && (uint64_t)(aLow << 1) && (a.low == aLow); @@ -829,7 +829,7 @@ floatx80 floatx80_silence_nan(floatx80 a, float_status *status) { /* None of the targets that have snan_bit_is_one use floatx80. */ assert(!snan_bit_is_one(status)); - a.low |= LIT64(0xC000000000000000); + a.low |= UINT64_C(0xC000000000000000); return a; } @@ -874,7 +874,7 @@ static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status) } if (a.high >> 1) { - z.low = LIT64(0x8000000000000000) | a.high >> 1; + z.low = UINT64_C(0x8000000000000000) | a.high >> 1; z.high = (((uint16_t)a.sign) << 15) | 0x7FFF; } else { z = floatx80_default_nan(status); @@ -969,7 +969,7 @@ int float128_is_signaling_nan(float128 a, float_status *status) && (a.low || (a.high & 0x0000FFFFFFFFFFFFULL)); } else { return (((a.high >> 47) & 0xFFFF) == 0xFFFE) - && (a.low || (a.high & LIT64(0x00007FFFFFFFFFFF))); + && (a.low || (a.high & UINT64_C(0x00007FFFFFFFFFFF))); } #endif } @@ -987,7 +987,7 @@ float128 float128_silence_nan(float128 a, float_status *status) if (snan_bit_is_one(status)) { return float128_default_nan(status); } else { - a.high |= LIT64(0x0000800000000000); + a.high |= UINT64_C(0x0000800000000000); return a; } #endif @@ -1025,7 +1025,7 @@ static float128 commonNaNToFloat128(commonNaNT a, float_status *status) } shift128Right(a.high, a.low, 16, &z.high, &z.low); - z.high |= (((uint64_t)a.sign) << 63) | LIT64(0x7FFF000000000000); + z.high |= (((uint64_t)a.sign) << 63) | UINT64_C(0x7FFF000000000000); return z; }