From patchwork Mon May 14 22:11:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135758 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp186127lji; Mon, 14 May 2018 15:12:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpKRxbQdIPZCd1g8SWpfUoDXXLEebTVNpOxCBSZrgZ3DWUspT/AaZOTkAYn/iZXCFBMEVIw X-Received: by 2002:ac8:330e:: with SMTP id t14-v6mr10890480qta.263.1526335976038; Mon, 14 May 2018 15:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526335976; cv=none; d=google.com; s=arc-20160816; b=KSIACjZ4fli4ZTydlK0nnZHQpSHwPmXpTFyQl+t9lho6E5Z6vM8HPq3+mdS8gOfOe0 JjDUTE/h5Q1n1a9Psp5kbHA36TMd529s+KMVhNfXhMP8gFmMRTgN0056R+mxOka3uReC zfr74P1S1Czh6FeDF+l4+yEEVoKoa7NgsM0+DMlUXTR7qGFnUechqsbBvUj/xxD5pZdF e8A9W+Ncd/2eFI9n3ApOy7yg/lcog/6HDizTw/PXX0gvWi4F6fIafJvaxRrBZsHqfL5R UTDy/QTef331dQlzu9yJdWPf2bJB/tU2Bb3Fela9m4LwR1lavR4oLyb2vo9YV5e+hgIZ lKSQ== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/eGeUttM52eudQ5TkxSYzl7bDNiiGBDFDqUuWF7ZJu0=; b=UTR5D7R2T7nIIjcnwoljdiX5148LNhYDrKuf7hLlqlJTcqVkyjJwDp8372rAk0wgua 8saxJemplaemqZpLiIeiBu3ko6EjEs7govQpDVyy+pKW+4OcvH0gpcC1/MjXfT9O71rz P/+1+gUgNaS34yvfYuTXM3whlo28eR5/sRl4NdsXQAwe0K83hN0TOYn/59ydc0yoS5Vp OEhRToV/1TZqiSk4lazZDSasYf3yD3qeSWyJwpDDdUH2Kh9H+rGWQu0Hr6grAH78cpHR a7zh9cfL4F/ELIQHkkmtEgjD2kihfOp4hDq16O8peJT7bM4T6DSAMLNDFqBItQbbJPzM Pd0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PDrBgN8m; 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 m41-v6si5178854qkh.35.2018.05.14.15.12.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 May 2018 15:12:56 -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=PDrBgN8m; 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]:49849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILiB-0007oe-8p for patch@linaro.org; Mon, 14 May 2018 18:12:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILhj-0007md-CK for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILhg-0007I5-W6 for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:27 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:41374) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILhg-0007G0-Pf for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:24 -0400 Received: by mail-pl0-x241.google.com with SMTP id az12-v6so8144532plb.8 for ; Mon, 14 May 2018 15:12:24 -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=/eGeUttM52eudQ5TkxSYzl7bDNiiGBDFDqUuWF7ZJu0=; b=PDrBgN8mttkQhEeVsJ8cF+pl9Uh1C85TtECdJP14WvAzINkIT5cG+JAWvaWvv+8m/8 /AYlMKpUNsl8CYQYJZHJiPC2pv0xzzEb+pZtn+cz3GrAcat9nfr8m+GFVMUvw6jAU0r6 DAdWh5QBKAfPUkfeW2rTm3cy2CVU6PZzyUoRg= 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=/eGeUttM52eudQ5TkxSYzl7bDNiiGBDFDqUuWF7ZJu0=; b=Hmrh+UCOnbuesEYFOHbR6zWHubdn9yLjyyuNhJKOXmYPVTKfu273/o8PGf/D9qwjpy +vqq/OBmOBxj3Zr4Oe6SPpNAl5sgSL1GaXTOIeji9Um3RxbdoMFszzZ9zjody2/0EJSn GCeLS5LUdik8A7gAKpOiZPcvOZ8QPB9OTInJFoIt++oA51IvRD42ZIZ38Ho+HoqFNuMo 0E9Xr8t6FzZxcPmIwnZTzDHjdzY9XgJFv/4UNXEblaNMMlIIQIC9gUrNCCvNDg41GMBp HUg8yooxJnhCzrwc4BGG2tQyhff7DaljBn3LWDNhfvpC46aQxqwGWXYkyyDgLYwZAKsS ++8g== X-Gm-Message-State: ALKqPwf7QVd6WnakvDk4bzITeCeML0jkTuleYWzPytzVcjxDAaGjT1z/ 13VV4dgA3dvkbHi9Jwp2jwYA2d5KvsE= X-Received: by 2002:a17:902:7288:: with SMTP id d8-v6mr11624458pll.218.1526335943603; Mon, 14 May 2018 15:12:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:12:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:11:52 -0700 Message-Id: <20180514221219.7091-2-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:c01::241 Subject: [Qemu-devel] [PATCH v5 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, alex.bennee@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 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 Reviewed-by: Alex Bennée 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); }