From patchwork Thu Mar 9 20:05:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 661132 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp504206wrb; Thu, 9 Mar 2023 12:25:54 -0800 (PST) X-Google-Smtp-Source: AK7set+qYV5+mvcGpwtXre4u6JsWBCIlY2PJaLyNNV+M9BuRRdcB1z15zeIvjpL1KVUSLl8Vnm29 X-Received: by 2002:a05:622a:1a8c:b0:3b9:bc8c:c1fb with SMTP id s12-20020a05622a1a8c00b003b9bc8cc1fbmr45161112qtc.6.1678393553934; Thu, 09 Mar 2023 12:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678393553; cv=none; d=google.com; s=arc-20160816; b=qWsW+DRrQdXsG4eIZpAx0cWOVGZw18Yp+wrc38FiYdBNDo37xvkfpPvcX9di2m1Sb/ +LpDECGCXjACe+4ldcfcDM+GeV/Jo5S5ZbOwN3xFH/Kqs1EJPJiizJhUJL9CKwYhjQig fY7c9gKl56FqhaUG3s3tJZ78IEmW/mWIeORh8GHIlKxfGIiqCZKz9+IA0VJpxPRYJRki OjT+lZdSq8WVXXTrVkGk69H8woXINwRCs0lEkKVo7hSWAR4YosIrnjrrwDEIJ2iOsKUS UaCCpUEypJi0lp35ylDLBkZ1ofATkG7mEcibNQKd6yJSxM7aaNe9maWspgvF5MK8ilS2 VfvA== 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=K2xLV2xfwp7i76hYEyFPtYKJPruD7udy/116L1MBmLQ=; b=v/BkEV7ONKVoSFjkCBv5HGjCnips+G3NCIE8Iooh1287XjvpNbrTZuAyutsjCAnbDw B1uWfhkJZRKQ8fGae8xpNi12nNE5TtjESj2Sh4R9cVmwBrnGflwqtHnwQg+yfyy/CMXb 1oTw6IUbHaRtORaIzyRKKR768aux6v97OiX721nP6sL9V5In0QR8to7C1RDXHuHsRqBS BLLusOwx3YLdgiS86R/mu424aDGkUoZTB1xgcmrEW1i0+rcPBTDivhxwdCvCPdQSeNLv ecyLAekqgxXFGzLgno02TWVcFE7fJjo+Gx3hdGtTtz4QnR2l51JE14NmEc1IPHuAtIGA fR3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uN/aJ+LP"; 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 o6-20020a05622a138600b003ac35eb41aesi14935638qtk.757.2023.03.09.12.25.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Mar 2023 12:25:53 -0800 (PST) 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="uN/aJ+LP"; 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 1paMe9-0001Hm-3q; Thu, 09 Mar 2023 15:13:53 -0500 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 1paMdl-0000Xa-GX for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:13:31 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paMdb-0002Iq-At for qemu-devel@nongnu.org; Thu, 09 Mar 2023 15:13:21 -0500 Received: by mail-pf1-x42c.google.com with SMTP id fa28so2255437pfb.12 for ; Thu, 09 Mar 2023 12:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678392797; 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=K2xLV2xfwp7i76hYEyFPtYKJPruD7udy/116L1MBmLQ=; b=uN/aJ+LP3hbnW0nlLU0AtdXrPnJwZuTqqZKVpYC7Vkfajiv6sbqItphYw4tqifi7jR hz1C/zFIB4i4o9FpuFZyKjBXNzmtWfkd6I/JhksiTtL46ZGjCD1CIYIiThO3JR8gmRWs oHqy3RdWfpH6EZsJpuRJMXXrIWjkc5qoV2OWuzLo95Tm+ZCtVHkj9L/aetOXvKqzlqJC fJGqmYZGch/+yUSczPu2YLh7a+lNs/Rw+HoKjbap0I/fgXHiRyDCzBTjzRU1jIlvYdtw /CQlh0+KNoLc2TXbagrLzFK06YHNvGWqvUArIm6MintLf9xJmO0Qfiqp8Y3X4DnTcine 1izA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678392797; 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=K2xLV2xfwp7i76hYEyFPtYKJPruD7udy/116L1MBmLQ=; b=uvIPHnlfyL2Vm2HZn6+lGs0O3Y9GBrFOh3EiOl5+tcGgYVBHHI2EYTlH7munJ2UBBg 3cyehtpjLKEMlVPi9O9kvYHTUuKpnufR4lkRLsSTo9GRfDt33WJku6JuTG4RXKN7SBuU n//gDXNBBCOvc53nRAhRl0I/dAaIB6xe/M0Lf/k4SsQqoUOYTB89eP2exPXMLvDu4Kax 8t6FL3iXrmhwnCiVD2TjJ4iaRKdzt0F1uTL+9eO/WUqVzSduGW6rCM8Y/zUl1NzHL42t HI+Ad6WraDfEDWwkE5fDK6CCDXz7VMbDcdrGbAVcj96QF16OugHBHza+J6ifEN4nYreu qpyQ== X-Gm-Message-State: AO0yUKXbPDTcoj9US3IDilWoghGOcevffVAGosRg4MQQdRK3JJ17+y+w ql4YOXvuMFTqr3De1SIq6hMJY41wLSPBAOMmF68= X-Received: by 2002:a05:6a00:13a8:b0:5a8:ac15:534d with SMTP id t40-20020a056a0013a800b005a8ac15534dmr31968054pfg.13.1678392791499; Thu, 09 Mar 2023 12:13:11 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:bf7f:79a0:a976:bdaf]) by smtp.gmail.com with ESMTPSA id v15-20020a62a50f000000b005b02ddd852dsm11867744pfm.142.2023.03.09.12.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 12:13:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Daniel Henrique Barboza Subject: [PULL v2 87/91] target/ppc: Fix gen_tlbsx_booke206 Date: Thu, 9 Mar 2023 12:05:46 -0800 Message-Id: <20230309200550.3878088-88-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309200550.3878088-1-richard.henderson@linaro.org> References: <20230309200550.3878088-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 Fix incorrect read from rD. Avoid adding 0 when rA == 0. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/ppc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index df324fc7ff..7ec940b7d8 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -5875,12 +5875,10 @@ static void gen_tlbsx_booke206(DisasContext *ctx) CHK_SV(ctx); if (rA(ctx->opcode)) { t0 = tcg_temp_new(); - tcg_gen_mov_tl(t0, cpu_gpr[rD(ctx->opcode)]); + tcg_gen_add_tl(t0, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); } else { - t0 = tcg_const_tl(0); + t0 = cpu_gpr[rB(ctx->opcode)]; } - - tcg_gen_add_tl(t0, t0, cpu_gpr[rB(ctx->opcode)]); gen_helper_booke206_tlbsx(cpu_env, t0); #endif /* defined(CONFIG_USER_ONLY) */ }