From patchwork Wed May 16 15:52:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 136014 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1100983lji; Wed, 16 May 2018 08:55:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZouRea2pg3ddHb5wRJF3dSmV4RHFKlqNNhM9FOq1rzAaj/PU8BWpK0+qy/Wq9Rx1ASKY3H2 X-Received: by 2002:a37:1a29:: with SMTP id a41-v6mr1339719qka.401.1526486159260; Wed, 16 May 2018 08:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526486159; cv=none; d=google.com; s=arc-20160816; b=wrwfbrAw5WWr3UEOgSQBQHq7uQJQmuZRKktc9FCjG9HBgJ9OTwZx40INRXjZcSqaFN E3npTx41yh+QNPPit8Nx3eBLK3RTJEsEbBIPQx+cm541TsMqfQqmNMv+Hlm/TcHw32CQ pxiHFKDWkqoo8YZ7cDbVR3BeUQSNgg/ox5REnx2MDp36NMlSgVSFMkLVWWYD9zq0mvWS 8mIGSeY0YjuzDZZKbEsetStW95K6cEqCuIzMg5S80wx7jndkEMPMyOXFKPBg+dprbV7b aiHUb0znyPoxoBoeKBt3nCn4PqJvVTxZJ6ypeEs2nKkCzIBPv04YZsrERQe0dNHHa/mf DGyw== 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:arc-authentication-results; bh=jDhX1u7/y5BhcUMp6xkxadIqpIgioPiIemVTRTRzYQI=; b=stl9Co85XHlVD1wotNRYKUHUSuXj32wC5Vx2TNGkgocyxFcmJF1MOdKpXEPshbutu8 y8v3CPIsHzU4EuNSVvdErXBeyYMAHnMOZQpwlM3d+Lh6jy6evl6K3xY8RzVyR5vjCPI+ xzlVsHd1Zz0ZDmZi2cJW7YUDrmFdOrlVjfludFxpZuq0CJmhiqFKmtqVpGXQBhg3xW2z v7VcwRalog2YjVQEucOINuQri1GQl0/yHNxAW6xYBLL+zqHojUeUkqavZ+cSwE6W4+at 2k5aSarxKcD2K6yqplxJhcDPZnccWkdX82bHIuTBSfpbFZSPj5vutTdCDDM5KP20RQcj HZdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ADNI65T0; 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 r5-v6si2876244qkf.321.2018.05.16.08.55.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 08:55:59 -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=ADNI65T0; 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]:52992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIymU-0005W3-Nc for patch@linaro.org; Wed, 16 May 2018 11:55:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIyjT-0004DR-G3 for qemu-devel@nongnu.org; Wed, 16 May 2018 11:52:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIyjR-0004z1-3l for qemu-devel@nongnu.org; Wed, 16 May 2018 11:52:51 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:37526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIyjQ-0004yZ-V9 for qemu-devel@nongnu.org; Wed, 16 May 2018 11:52:49 -0400 Received: by mail-pf0-x242.google.com with SMTP id e9-v6so570980pfi.4 for ; Wed, 16 May 2018 08:52:48 -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=jDhX1u7/y5BhcUMp6xkxadIqpIgioPiIemVTRTRzYQI=; b=ADNI65T0aKuwQtlj8bzlSekCiuX+79HeGbZOYfDqL5she3ZwYM+92GDRumRWf5hISH 88zROVImcAP08RyWANytVPctaSyFEBwg/fuD42J92EoQbzzeCC0kvATD35wJfL0teEOo xZ0sj4Lj3fxLs3UbbsExXmZvxFVx4YoO4lq14= 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=jDhX1u7/y5BhcUMp6xkxadIqpIgioPiIemVTRTRzYQI=; b=pErn5T7RaGR9Mh4Wu/MRzfcTHbNEA5iYZhmFME9+KvZ1yf03RoO+k9HOwoUVH5tjH/ ZaJ5UMSGuibXkxpeQDx6YSXyw5blFPsbNma8q9lgA7rzqYo4c2PNvJzPkfykmymcaU70 7Qy0N5FZTlk9WSnlLR2PA1Qu0VXCOZxbincvm9smDUw/G8gSWDN9CVPGbxhHfDoOJOQq UhkdURjXBKMoBvYjUun2gVOaMHkg7hMSPTFvuJ/uvF8QRVKBOG6+1O7Yqc2QNO2ZnC+A Yq2JZUCbBRtdNF1WMKsIi/qq2BpQHvI+rXtHLBmILUHGfOocitEJlPkJo71CWxbXojcI ekIQ== X-Gm-Message-State: ALKqPwcrwE3JgYigySO47/nDCM1Ry8Lu9SVsYakuurguHVE5a0VODgea x7W8C5ky/kQ/xxEkjKBkPklwCaxRsS8= X-Received: by 2002:a65:4b8d:: with SMTP id t13-v6mr1163075pgq.53.1526485967571; Wed, 16 May 2018 08:52:47 -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 c3-v6sm4966632pfn.62.2018.05.16.08.52.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 08:52:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 08:52:16 -0700 Message-Id: <20180516155243.16937-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516155243.16937-1-richard.henderson@linaro.org> References: <20180516155243.16937-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PULL 01/28] fpu/softfloat: Fix conversion from uint64 to float128 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, qemu-stable@nongnu.org, Petr Tesarik Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Petr Tesarik The significand is passed to normalizeRoundAndPackFloat128() as high first, low second. The current code passes the integer first, so the result is incorrectly shifted left by 64 bits. This bug affects the emulation of s390x instruction CXLGBR (convert from logical 64-bit binary-integer operand to extended BFP result). Cc: qemu-stable@nongnu.org Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell Signed-off-by: Petr Tesarik Message-Id: <20180511071052.1443-1-ptesarik@suse.com> Signed-off-by: Richard Henderson --- fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.0 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index bc0f52fa54..d07419324a 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3147,7 +3147,7 @@ float128 uint64_to_float128(uint64_t a, float_status *status) if (a == 0) { return float128_zero; } - return normalizeRoundAndPackFloat128(0, 0x406E, a, 0, status); + return normalizeRoundAndPackFloat128(0, 0x406E, 0, a, status); }