From patchwork Fri Mar 29 22:30:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 784093 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp3429001wrt; Fri, 29 Mar 2024 15:32:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWvy+qeiAsPKtamyNtJF0eGkwh1yXsaqqL6egqyd15c9GKcG4hK31B2Ts1Ttlk0sdQr86VkZGmjz9H1FrZaA6cm X-Google-Smtp-Source: AGHT+IGAqCPdc6KM77QTaQiWyO1mpgzHdZJgV7hCzKBoCSE/be2zX6eQ1vcG4oJm+fG7G4gSdUOO X-Received: by 2002:a05:620a:5e0d:b0:78b:bbb2:42a4 with SMTP id xz13-20020a05620a5e0d00b0078bbbb242a4mr4033161qkn.10.1711751548447; Fri, 29 Mar 2024 15:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711751548; cv=none; d=google.com; s=arc-20160816; b=T/ov9mncIMEMaPc5ozoLqbzw3PGrG07GaJtUYOMRfiTKAqkLd04LXUPXlmmfe9iQfv VxHUSMOXK9oHzJIwJYSnlve4Fw5UwejzZE3i5xlVgkGjXZSwPiy/Z2YkhQGnNt4LVWQ+ xqVOUkNgvJH4HCSvUyxapY350clPs97vLH1xF1I8QOau2X9QVLVUz0rns4ymkIfcUDNM 9uIuPGFT1BuVEL/RYNxGwdu1PD2qyaEE8nXm/JeBeba7XAviw3wG+yA+0vLFTp2vcsZ/ Ew87UwTnpLLI65t0AiJavZ5ui/HBuzT0k8bFFMvair10dH4TEq+pueH4KqOs5lGuIx90 YYYg== 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:cc:to :from:dkim-signature; bh=iCXMa8NXK4SslxAJzO8oJ4YsLhlZ/FlXinB3WAZag7c=; fh=VrHP4sfoKA8I1LkS7u+zyL5sfQ9auI1Z6YYiaQiPlIc=; b=SEniYW34RVtis5DcEp/AEf+IeM92aXr2hYTQGf04HbUobjAznSi+IN82G/4c9IOLqH 8y/yD722aSCQcnH76kGs60sTkA8B/T1NqtYE8nAaI6HqGmk+B0VY9tc9+rQxMr3GpAKA Bzw2OA9YsMyWT6OwxNKGPfaon0KvqdLiYKFV3kD/KKipoQ4H9hxONoJVWsrBSC+I7UNe 8Xzx2ZyVMB7JxlnattHnCP79FRhn/WNtYlHTeR1AnaIsSOLnSpQQy1xrAnrzEnXKwJMt 1KlvjYIm+u2dqMoqFD04cee/R33pKHjYry5UaFkGAlkN50Q1zxIzZWXHh3udxWZd1eq2 HyQQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tLImgu+5; 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 w11-20020a05620a444b00b0078bc4cad727si3720058qkp.245.2024.03.29.15.32.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2024 15:32:28 -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=tLImgu+5; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqKl7-0002Zq-27; Fri, 29 Mar 2024 18:31:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqKkv-0002W3-3V for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:25 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqKks-0003VH-1p for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:24 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5d4d15ec7c5so1734906a12.1 for ; Fri, 29 Mar 2024 15:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711751480; x=1712356280; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iCXMa8NXK4SslxAJzO8oJ4YsLhlZ/FlXinB3WAZag7c=; b=tLImgu+58HnflaRw5SS2lfQQZs06avrVcNc9Burbqh84B3sRVJoiAzumDMW6zeQJMV jJ8dbVdV+ezqCjF2Sb8BQHpGmN7z/wYbqMj1VvT/Xsc8QUglzjKIITxbg2RRzDhTni3x UFZaJNoBsmwAxE/+mwNvfFEdZPmQm85C4FC5FRyFIj+/M0OKTat8dnpaZOp0RHxMNwuo R69SRPeXKGyZLEBjVg2RqZkDBlupj9rj4oYI7oWLUVJGtmQFo7LoLyEeBc+DS7G5I7l4 DHGUw695U/zpx1s2Q8QeZv2FMLDi/TtmnAmyptMRJSiZeQvXifwsHnlw0iNUu6SDqbYS JP8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711751480; x=1712356280; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iCXMa8NXK4SslxAJzO8oJ4YsLhlZ/FlXinB3WAZag7c=; b=Yy6vtj98HtZPCqo3l/86cEbqjI/tQ2XZGkl+WK9bBg0Lmw5dT0/wdk8BvmbMoGpgpZ 527zHqsRUXuBPGX3NC48cHKDRnRYj9nsWAFuT1PH58cE2wegU73dqYhQdyL4khyYsi06 42BHupxEqhZuTfIav8CHc9Ma0P38QN5XAaMa27VFFIk4CQYi/ApkDJZPElzxheFq+Qa4 oqrEbQgAEPxdz99DTHNq0M+fbi1ycGKZ9yhvwMmuDUEPwJTbwWpcXyuzGHmDmhwQlrVX BOjKUTiuRsoutOiFpsD3jLqyDBc9m8r13XXJQZgMzpQKsCzYQJBKrg7Jp1MCHpHjCskS W4hQ== X-Gm-Message-State: AOJu0Yyt+7ECMJaMieK/eAmCMNrfVjgwWPq7iqF6YinLlGYk2JA6elFj s3ROXNpoC1oQvRcy6O5nPMBVOYs2i9+POno2BdNCJ0QmpMpa0JpwNPh+Uzh09d7xP2Dd1p13DG9 x X-Received: by 2002:a17:902:6506:b0:1e2:1dda:262f with SMTP id b6-20020a170902650600b001e21dda262fmr3552634plk.32.1711751480562; Fri, 29 Mar 2024 15:31:20 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id f8-20020a170902684800b001e09b636cafsm4000955pln.287.2024.03.29.15.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 15:31:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Sven Schnelle Subject: [PULL 04/18] target/hppa: Fix ADD/SUB trap on overflow for narrow mode Date: Fri, 29 Mar 2024 12:30:57 -1000 Message-Id: <20240329223111.1735826-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329223111.1735826-1-richard.henderson@linaro.org> References: <20240329223111.1735826-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org From: Sven Schnelle Fixes: c53e401ed9ff ("target/hppa: Remove TARGET_REGISTER_BITS") Signed-off-by: Sven Schnelle Reviewed-by: Richard Henderson Message-Id: <20240321184228.611897-2-svens@stackframe.org> Signed-off-by: Richard Henderson --- target/hppa/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2cb91956da..ceb739c54a 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1126,6 +1126,9 @@ static void do_add(DisasContext *ctx, unsigned rt, TCGv_i64 in1, if (is_tsv || cond_need_sv(c)) { sv = do_add_sv(ctx, dest, in1, in2); if (is_tsv) { + if (!d) { + tcg_gen_ext32s_i64(sv, sv); + } /* ??? Need to include overflow from shift. */ gen_helper_tsv(tcg_env, sv); } @@ -1217,6 +1220,9 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_i64 in1, if (is_tsv || cond_need_sv(c)) { sv = do_sub_sv(ctx, dest, in1, in2); if (is_tsv) { + if (!d) { + tcg_gen_ext32s_i64(sv, sv); + } gen_helper_tsv(tcg_env, sv); } }