From patchwork Tue Mar 7 18:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659838 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541128wrb; Tue, 7 Mar 2023 10:37:29 -0800 (PST) X-Google-Smtp-Source: AK7set8sxf8gkO6RoPqV/i0/zZU9VSc9hirdzAjdSDdj3RRSDwZvkVlU3AwAqmWCCqL9YN7SslXn X-Received: by 2002:ac8:5952:0:b0:3ac:1bd5:b7ad with SMTP id 18-20020ac85952000000b003ac1bd5b7admr24912548qtz.33.1678214248814; Tue, 07 Mar 2023 10:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214248; cv=none; d=google.com; s=arc-20160816; b=gP72OKBQTgNAkz6ksRRlxecXKoSx8VpNttETiQ1mTui1+33Ae1fqq0K3mfjVAdJOoB Yogp+D9tt55mlmo0QGPhUPsRYMf9oinSonUcy/EL8GMAHpMNFV70+YkMC5KLDZ1JZpa0 6xqMC+eMG4fOLO/9ETIO2gxNQhoHfvsYc2jH38gY6YppeqCcQLqL1486FKG8hTJIDJCh O7Aeks6zfvbXEYciWsjSAfed+lsqeny5ZrC330qk9t2GmHOW0FEntH0KJB4VBNTQeCji R+dYIAEefVblLsqW811wHIWsu0R9ENNZB9yiL76O16btngr39rP7O/yTfb7wSHg1FC8I 04KQ== 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=T0xYEb0puxBCANW9rQSyWliBlkhDKpxgX66MAghw14Ihic8/Pvso9ba/kRBir/fgTr J0w3hXuvWdekVdXBq1kzAjYwzQA/mQPP+wJN8Rj1XzSff/ntv3lXBBELzFyBjy6J6fGa wT+GCmx90INz9pwT5TLGIiVOhhfCYx6WMc7kB2B8w03OVoDKU3d2DA/OGJFMNBzWwGly 095Blb3Q0zP+cembC5gaTnyeCbOAjpx/Hylh9MlQFT0FCmT4GaXhVqzMECzJjtIFjN71 MRxRGDNnJNU45WOn0z1OOvwPOnhMHm8UUyVwJ3WdccOcrngceaOqShKDLbDALJEUbuV0 s+gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/XFRR2t"; 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 w2-20020ac87e82000000b003bce12b291csi9839538qtj.320.2023.03.07.10.37.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37:28 -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="I/XFRR2t"; 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 1pZc9l-0003o5-8K; Tue, 07 Mar 2023 13:35:25 -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 1pZc9j-0003mz-MP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:23 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9h-0007nq-U7 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:23 -0500 Received: by mail-pj1-x1032.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so17432236pjb.3 for ; Tue, 07 Mar 2023 10:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214121; 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=I/XFRR2tDNSGqeRNJhUx2b1vKxcet3+Kbn0D0IqFfArsCAJeFWOsRBC1PSuXtbSw5G iaSn5C5Wog8XFrhTqMkIa4ju2Kw0RWBLAPO5xJpk3Rwpx1Zmij7FKGZTvyS+MQFGb6nH vH0vNPeFHRHwfo/wpf4l5wUk3FgiJ5OLSybGy3d+g8gOfPs5RtBXe1YV/ahw5FL0M+km AE5QqVduIaQdpM9DHeBV0vDTvyJVRDtfd9eHbT6ziVSh5g0SXohdMPbzE3E1m4wVOMiv lQhbOSLi303XwXebYWgqmKmrtKiW2D8Ud1xeCe+klLfwwE6blMUz0jrnt58joCtOoQyV HYWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214121; 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=LIA5lyu72UoyktRo5ZZHrbWGZ6mRLBfl4g9SJxP0V7m00+cK2s0p6akDSnSsLR6J2Z pifHNR2FyeJWLOsjdpMhSO3Y5SEyjY+vtlmBStAT8Ps+WTXcAYv+GSuhYrm71Kr2Es+c dTXqTMCyr7g1PiN016Om4uwMg4CXRhTjUhxWGeHgX2mFSb3UVYI/RAsIwisgWzL/f6zu dY4/uOqd7/f9jSGcj5F6VOSv6WjA3KqF/xwurvuw3UALfgwpyLWP8Fbn4VsGnwmhfNga Nf6KyUhQBPcpf/RHeF1Rkf+GY4EbepqVXkJOOT0PttdARfDYHDl/rHXSpYhzT8Dtnl+g 0t/g== X-Gm-Message-State: AO0yUKU92ulvQyEBKRFHe2PMclQTEEtYSiQLRKDmk/AjP6V87HqedwFU L7NlB7+1bpeNe+pPn/N7LkQLdKULICAEBK24KuM= X-Received: by 2002:a17:90b:388f:b0:23a:63:6d37 with SMTP id mu15-20020a17090b388f00b0023a00636d37mr15836598pjb.6.1678214121171; Tue, 07 Mar 2023 10:35:21 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 21/25] target/ppc: Fix gen_tlbsx_booke206 Date: Tue, 7 Mar 2023 10:34:59 -0800 Message-Id: <20230307183503.2512684-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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) */ }