From patchwork Mon Jun 21 23:18:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464629 Delivered-To: patch@linaro.org Received: by 2002:a17:906:71d0:0:0:0:0 with SMTP id i16csp4673760ejk; Mon, 21 Jun 2021 16:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbRkCsb2bUHzzgngzHX/3UgvB4CmZKqN6hGtPknIC8P4vfgn8u5VrLgGq2u2AX1Tq5xa6E X-Received: by 2002:a05:6214:8ec:: with SMTP id dr12mr22554216qvb.48.1624318156357; Mon, 21 Jun 2021 16:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624318156; cv=none; d=google.com; s=arc-20160816; b=rPEg54PL0Es/nG8Qb2L0PCnkvng1O//Hzf+rIcKJ15cQZsrw0QFSiI1XlYVWRSXtpS BP6m1LTP3rlzm6lpEgmwhaVutevmtLOsTHadMyEh1XwvdVCCzN3McZWCq45FxADFNIR0 DLgGw/PYwhAaEPyxRQ+dD0ioMwDepY3yT22bHFpyVC/bLdnnUxu/y5khmb2PO3v3U7oC 00PB4BgACwiY0JMzXOmFSfdYx8HkqNDILf0z3x9RBAROakKeD1NF5xoljwNUoKfFFF9E iKsLqU+al9OgjU1ujgwU7DANFL1OyZIeDyxVr1/m+DWW+hIR+GqD91Du2PxslfyEJJh+ Ixxw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=48z68ulW8GGIpMYTx1SRl+BJDLbN2VvaGGeLWdHXQ9E=; b=HRVJ9vCTb11taiSAV5oIJWP78AmpbotVhcoqW9PuToPBoyEQPUn8LXKtt0IzzYPYbL 1udB6TvXSXUERToS8U3i+8yM5DaexecNnGqIFjKXEF9o/66X8CL5LaZD3/8qO6Avj96U IyGPm31/A6yBiJqF3TXGofJoMFC8A5XYYP5fVLMOlOhk+LemoxA81U0SUbCekzDUgaIM ZImxsVcOtCHMyPsvZKj3MP/ar1Lt6jOnhzZaEN1pVFMO2Y1PDCwOZIM2snZl3t70UoXf VE84XvoVCu+wl17iw1v7KtlU99M7b0gqkohptK7oaNq9XXkjx/fF+/F0MBG6IGY7DDlu sk9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ik9OLGwx; 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 13si350303qtw.381.2021.06.21.16.29.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jun 2021 16:29:16 -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=ik9OLGwx; 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]:33716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvTLv-0007CT-My for patch@linaro.org; Mon, 21 Jun 2021 19:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvTCB-0001Fb-FM for qemu-devel@nongnu.org; Mon, 21 Jun 2021 19:19:11 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:34356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvTC8-00062q-LC for qemu-devel@nongnu.org; Mon, 21 Jun 2021 19:19:11 -0400 Received: by mail-pj1-x1031.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso736232pjx.1 for ; Mon, 21 Jun 2021 16:19:08 -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=48z68ulW8GGIpMYTx1SRl+BJDLbN2VvaGGeLWdHXQ9E=; b=ik9OLGwxhyWb7jtxZOih9jWRXRamr6sJrXfok3YGTAGuAks3ctMThGyJLyAoAyvn/E s4DhG7Z6OI5kJQ36HXO6ww3mamXv+uplBn3Rfo+p4KHRrtVk6gzvWXkNKhQwt+12gtFN DfHgSava8r1Hl4JMKzzBTCYleDzJ0TsYTdmp1ctKJyP97lSmKdzCGMbdlTy88feQQXOn ovup/pdgtO0YHmDyz2Tld6gonwdI5vXYu7VCciMRwOgYJ7lCi43cUlXMsq/cEA5+Fm+H D05i+ripmj7Xc319Rpf9VAho/zJvGLA2jS9oXD0LuSR9jNHr5Y9G0QUvIMt8SNhtef+s yC6Q== 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=48z68ulW8GGIpMYTx1SRl+BJDLbN2VvaGGeLWdHXQ9E=; b=Y5+vNMYStdXSeQUUEHpr0TEhajU3hSXsKcZt4yoqhnkl/rp2okVaIFkrt/jIEardkh PIUlqa/1xryvc7nIso4+tPJvWr5Md/gAkfv7ksYxQYodssYR/Wz9oNx4JjjTEphsy4As eus6Ejp2QVdt9J5GOUaJKOxvLwL2DAvxrzruJrmAYQXNmHzuXb8h5vGnqQaInhjiokGf 4iISu3iGVAyr1nw56ekM4e82fpauWanmRsXc8sbDZncKoToOoV6XPcnX9AqWREUeu1Vi SR8Et45PXWDVIQrPzLvOmu9Ur19VYtykROi4Jnst/3AHvKgKSAGzCQXgKW5oMJPvkWY1 DwhA== X-Gm-Message-State: AOAM5339+jHUzd/psAVN7cEBn2Md049O3fnYr6s8XDgL1oBKZYjx/fNU blJ5ybohVWxm6G5In7n0pV4UEdXk2QAFGA== X-Received: by 2002:a17:902:8207:b029:124:4f60:740e with SMTP id x7-20020a1709028207b02901244f60740emr8568522pln.56.1624317547387; Mon, 21 Jun 2021 16:19:07 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 135sm14429952pgf.20.2021.06.21.16.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 16:19:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 26/29] target/mips: Fix gen_mxu_s32ldd_s32lddr Date: Mon, 21 Jun 2021 16:18:46 -0700 Message-Id: <20210621231849.1871164-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210621231849.1871164-1-richard.henderson@linaro.org> References: <20210621231849.1871164-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There were two bugs here: (1) the required endianness was not present in the MemOp, and (2) we were not providing a zero-extended input to the bswap as semantics required. The best fix is to fold the bswap into the memory operation, producing the desired result directly. Acked-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/mxu_translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.25.1 diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c index c12cf78df7..f4356432c7 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -857,12 +857,8 @@ static void gen_mxu_s32ldd_s32lddr(DisasContext *ctx) tcg_gen_ori_tl(t1, t1, 0xFFFFF000); } tcg_gen_add_tl(t1, t0, t1); - tcg_gen_qemu_ld_tl(t1, t1, ctx->mem_idx, MO_SL); + tcg_gen_qemu_ld_tl(t1, t1, ctx->mem_idx, MO_TESL ^ (sel * MO_BSWAP)); - if (sel == 1) { - /* S32LDDR */ - tcg_gen_bswap32_tl(t1, t1, TCG_BSWAP_IZ | TCG_BSWAP_OZ); - } gen_store_mxu_gpr(t1, XRa); tcg_temp_free(t0);