From patchwork Tue Oct 22 13:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 177161 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4874310ill; Tue, 22 Oct 2019 06:35:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwzu+uLrdg1EV9QTDde4jIonePFwj19SXA4nGMYhy36LhJghxRRxDj8jWQxjDmBhmQeI09 X-Received: by 2002:a17:906:bceb:: with SMTP id op11mr7119124ejb.197.1571751332734; Tue, 22 Oct 2019 06:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571751332; cv=none; d=google.com; s=arc-20160816; b=ml4wbkVFZWj1PyuHF9lz8ZlPnEFeuTTclvOpFaNp9E9DWyz+ZDTy/zsByxqmJiYTrX W4XKpCkcajE4Iq9WWYK3UMGhvloufJbd7AYpL4/329lq/5MzVLKd49IukM/cQdqDfapP m/uNHViD9RGiN28CDSrJDEOgO5wrt/2Ya82emEZZfGFo1VA6ROu+wkI99UZT7uv+cr21 nJT57pA5OtDkmOS6lgmVaAJCSArDPcB2paus68GSjZwh3V2fkrpSzuo+6+4QUUqVAw2D cYqNX4Epk8+w1foTgyYsTTGgZu2GYeQHFA3hzEBEq5RgDRekEYQ+mPOJAmqbrEyT8S7/ HvOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Tszmi8yysvRuCxwYylX4mScv+Q4hFjeHGWVpSd5q8fA=; b=kSGHR+gLcUvoXUK+cT2b0FkEr3n4pqxALnnga2QKuO9yo5ugKNGHGOJnT4nDrrZr9d NEVm5J6bDfD9S2dbX6Dr2Vwz1+z272Alav4P5her+9g2BjkAij7IQxKejDAFcdhs7LBp M5TngVV7EmWDqeSKj/D0esD51IeGMBKgs1ht6RwnablKM39ezU5wBxnahkCtrZUlpIad U+IlRpbX1UdafCxgw60FhCXgBLFcOmhnEsI66qNzs2I5yvolVbHoz2d8yRggtYL8HQrT yzYE36JYAnq93DWC8/Z2uRKIRTpgSR34T8yLX7AItl8wfSPke2jwaiOTbz3uCOwOFEdY ZdJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VmRf/RQn"; 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=pass (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 r4si419387ejz.77.2019.10.22.06.35.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Oct 2019 06:35:32 -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=pass header.i=@linaro.org header.s=google header.b="VmRf/RQn"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMuJu-0006Lr-LK for patch@linaro.org; Tue, 22 Oct 2019 09:35:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36555) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMuGF-00022T-TO for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:31:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMuGE-00017O-TT for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:31:43 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMuGE-00016z-NL for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:31:42 -0400 Received: by mail-wm1-x344.google.com with SMTP id g24so8122191wmh.5 for ; Tue, 22 Oct 2019 06:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Tszmi8yysvRuCxwYylX4mScv+Q4hFjeHGWVpSd5q8fA=; b=VmRf/RQnlFjM96sBtBuhhuo7eK2/nliOPO2lG0/lgEOZogm8B9k1WmE1mm2ZrKvhbI jxeFvOT31m1NFobO4qwvVYqaqyZ4ubiwSJrWmCfcrBQFzwQloEqgNnDGx7tI8SUtrjdw Ay2cQ8XEyMZ4ShfsvX1QwG7XX5+3HOfX9hFsyjkcp0ttSuR+NGg5ihVG+9kMR34STOTG o24PTgBxb6Chn7ZQE16mc/yatYXGuiK2eh5wZ2x8Azqh6hVWnhS0UPmJcGAVPD4TlXgv xC21xdZksFhjhdUBK19Tesc6Bb4Kn2twM+Sh9MIv9MBIFS5gfdSaWuHNkMI/U+MU/My2 Idlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tszmi8yysvRuCxwYylX4mScv+Q4hFjeHGWVpSd5q8fA=; b=LF6eAGwg/X545HNSuhuHTzePHfyzFshrRP3icPc33lBqw+wV9h4I/GAIISP2uSUcsw tKunztF380TbI0iGlvMfiEftc8Q5brvR9xiB8SzCLy92mXsL9ab0Y30u54pUIlai2OZm HiEvTqIPvFCp/iFZrmWaWbcSPQDDaKDgKpBQXBr25oTYWBYfSzRiB1cMCiuvUm4+v6S5 /ge9lJ5SlrzwR1PwIHsCeSFdC1yBcYRo13MQcqAyk5utLqYr3BKGKQ0TLWd1D4MSglLz pQixPmKqD4MeZxNctnMDwk/vYhABQkDdoSnfbyaIqfQOxXVCvYnE3mMeACDWavnbCAiD HpmA== X-Gm-Message-State: APjAAAW+PvZrlrVXyad744ZmHD5HFeh0Zq8+CC9NxXvhjdpluu59BKsV PYCIrswYJAb7RTfXZKIES+vU8COhTaU= X-Received: by 2002:a1c:6a04:: with SMTP id f4mr3149513wmc.60.1571751101014; Tue, 22 Oct 2019 06:31:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r2sm20263856wma.1.2019.10.22.06.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 06:31:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/41] target/arm: Fix sign-extension for SMLAL* Date: Tue, 22 Oct 2019 14:30:54 +0100 Message-Id: <20191022133134.14487-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191022133134.14487-1-peter.maydell@linaro.org> References: <20191022133134.14487-1-peter.maydell@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::344 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The 32-bit product should be sign-extended, not zero-extended. Fixes: ea96b374641b Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-by: Laurent Desnogues Message-id: 20190912183058.17947-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 698c594e8ce..96340520ee2 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -8045,7 +8045,9 @@ static bool op_smlaxxx(DisasContext *s, arg_rrrr *a, case 2: tl = load_reg(s, a->ra); th = load_reg(s, a->rd); - t1 = tcg_const_i32(0); + /* Sign-extend the 32-bit product to 64 bits. */ + t1 = tcg_temp_new_i32(); + tcg_gen_sari_i32(t1, t0, 31); tcg_gen_add2_i32(tl, th, tl, th, t0, t1); tcg_temp_free_i32(t0); tcg_temp_free_i32(t1);