From patchwork Tue May 15 22:25:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135938 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp76441lji; Tue, 15 May 2018 15:29:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEiko2jAzFpdOcIUB78uY9isWkKt4Ul6ImOp845Cf5cDKZ3TqppTBi+Dg56/yv5qQqbl1o X-Received: by 2002:ac8:6108:: with SMTP id a8-v6mr16155857qtm.225.1526423374168; Tue, 15 May 2018 15:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526423374; cv=none; d=google.com; s=arc-20160816; b=nD3nQ1KotMVtkBtKEqXVaNn6qHtDYW7ZdeggfeO5ettqkq5NeTqoc7AqdYoK8lmWQY pwP/ddXcwKcD2jPtJTZ/nu9jQ8Gbfygdoqzwq0tRI8WKnr2VYelO2ku0kVyo4YwRE7jl 68NrsuclX13AVbPgbaFEfh8bhwjmG5eBWTvrmQWZ6BFTeM4WdX5NhUZXyK/+zACyHlY3 sqMJIrQJkwaeWudKuHXWQUH+OViBcbgQD4/ERZTMH4aT+ov0sKO/RFM7xj4+gAsyLVL+ EGxjsGllOAIbcjuZysddfTlDdaOgiuRHh2yu3nZhkJ58+ERCzSnxU6+it5CNal4QBLlh Yuog== 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=vcY4MypH53zafXSomIoTtIYN4nhgI2OkCF7gRTLuxMBhLz3VPW4k3Xyt9yaU73VMBn 9X9xHxLyA+RH4IYGlgyFC7Kb5UwPLY7hOhK2WD9MOUTX2Jyz2LHGXdYcTrV+SsGhuW8p VnnrnXonx9bsQ43+dxajT+3YFNsrvFyBKlxKKieFJxVOMlx7tSNuQqztIlmmCEBoPC8K W2xL6Zs24g49h4LJSTukAiSjRcA/UJVX/4TFzwPVcvLqnKPJPeonqRN9moh6FBiwIcSb SkqASHhhxDYS2u+aHO/Pwh9lCGdaEc6mnCuPa7JZvbFWIT8GJ8Jg2VkIln8WMamwn1Nc 7OEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hKaVPx1H; 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 d185-v6si1179574qkg.176.2018.05.15.15.29.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 15 May 2018 15:29:34 -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=hKaVPx1H; 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]:36319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIiRp-0005nY-Hd for patch@linaro.org; Tue, 15 May 2018 18:29:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIiOE-0003Fl-7J for qemu-devel@nongnu.org; Tue, 15 May 2018 18:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIiOB-0003Ld-7l for qemu-devel@nongnu.org; Tue, 15 May 2018 18:25:50 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:38708) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIiOB-0003GE-25 for qemu-devel@nongnu.org; Tue, 15 May 2018 18:25:47 -0400 Received: by mail-pg0-x241.google.com with SMTP id n9-v6so654443pgq.5 for ; Tue, 15 May 2018 15:25:46 -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=hKaVPx1HpkY0Y/5tB0EEu7vt5+5kjjq4/nyJzddp8RByudPI0hyjrHhY5+69cIILCX tXLzAx/GM9lk3/pG4JPjLRiqDUjVZRxa1Yd2WkRUzgCiHo+fXN/bK/rkpKh0zlqYAqJH pyxoP5Bw9llCivxLM+7nBswbaAKuHCrqZIqTM= 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=C13BubWOtt3hJvMVxfEvF/T7rTqMsewJzZS7W/Y6tWH8S58TGz3fPhZUQCSU5eHp5+ jW6K6y/Af8UVapMIyhICMHUwgjjaY4GvbbHn+5wjwpt1jBkAl6rbF2KE7ClUHYqhs3Og 9Ugz7yK0FUkvAtt/GNZdWKRVZvkIe0WFssLowALXOYN/uIlMrrpiKwO5225A3vhxWCzU v32A/sLG1vrSPwMC8fsZl1y5n9u+7/uT2QCNDG6Y7ROqtu43vsipZ2JfQ+5gherLHCg0 57CEDr6Be28jkbC13WaRP55rZ4VgBr9XQuzRBoV/f041JbYW5Dml6GUAV4yHbhaN66E/ qU1w== X-Gm-Message-State: ALKqPwegH8vPTKBElx95Hw90x5ILjd8Zfl71G1EqSSsIDDpuytphMCyS oNg2aHW+hGtzGzBnupaOj/k6EkpixjE= X-Received: by 2002:a65:6489:: with SMTP id e9-v6mr13787783pgv.44.1526423145784; Tue, 15 May 2018 15:25:45 -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 g11-v6sm941419pgq.62.2018.05.15.15.25.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 15:25:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 15 May 2018 15:25:13 -0700 Message-Id: <20180515222540.9988-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515222540.9988-1-richard.henderson@linaro.org> References: <20180515222540.9988-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:c05::241 Subject: [Qemu-devel] [PATCH v6 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 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); }