From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02537C49EA6 for ; Sat, 26 Jun 2021 06:46:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7D266141F for ; Sat, 26 Jun 2021 06:46:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7D266141F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lx251-0002Wq-Ri for qemu-devel@archiver.kernel.org; Sat, 26 Jun 2021 02:46:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lx1vv-0002Tc-KB for qemu-devel@nongnu.org; Sat, 26 Jun 2021 02:36:51 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:42498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lx1vt-0000Ro-OQ for qemu-devel@nongnu.org; Sat, 26 Jun 2021 02:36:51 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 13-20020a17090a08cdb029016eed209ca4so6847425pjn.1 for ; Fri, 25 Jun 2021 23:36:49 -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=Fczfrazl50zhvzi66NatB6O7zVyLRVIPPsaB68bWBnLp5RCX+9Rk0ADJ1dKvKAp6aH ipgPoIqsURINyQjP9RLiXJJ3Shkbxh4uVctdgBVKTLQNAU0rGpFf5NLAxd36a0Q1EhhU p9FozHqDiwazuqqtI4U1YTPlUW9RMYnuxwA4NR2EIikQVhXLJ8IAldMKLGYloLm1ncpR afKGiFbFt/8pEAy6Icqyspa6ntsABw/aVmfItp1RHCoxyi9ukK7OG1wbp6S9t9Emlhmo KFflfwYPMrMXadGocXazU+WktIn5PR6lKh+an1WqNLS/BUvT9F3vZ2cvlI2xlcdjUln7 942w== 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=QdssOWUrMp2RuH/KkKX2dcehNYKhghuSiAy2j4FOFR1OZIFZE5/uYcgmSqWTlrP4uR EbRC751VZrstKABxg5LDcDC26aNHOzAtljTO3o3AUYquezx01wTiUOewiVgIWmvjqD1i +ihL3PeiDKRfef8hWJdqjOKgenjlG3FTFA3R5svqDErzWrn4dwXIct9KKksyltRLtd5A OxVEvZUyVOWBHImyLv3rWS7w6UEes4T7OIQ+3ckZ/TP/PF6MPhk+Xbvniq6yC4MeZvw7 Ker/1Jt8KF2pJ4RCPx81dqRg2E+xtNfV8jMzoALt6uUnYmhzrO213y4jUf5Fe3ncgLrJ Bxuw== X-Gm-Message-State: AOAM531pgJdzjTadxwJ3CXnq9+mgfjdGLReWWOmPRXxuol9vjRFUxsCQ lNXUzxJYGONpIIzuTtJ9CRs/GqvKmMDOvw== X-Google-Smtp-Source: ABdhPJza+zHprM4AUArvm+gdRwuu5FB8adDN0gN+wgD7NxIkFfRdDIVDIVhGsxbvTs+jSnucW/R7XQ== X-Received: by 2002:a17:90b:2504:: with SMTP id ns4mr12293945pjb.140.1624689408388; Fri, 25 Jun 2021 23:36:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id v9sm7724201pgq.54.2021.06.25.23.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 23:36:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 26/29] target/mips: Fix gen_mxu_s32ldd_s32lddr Date: Fri, 25 Jun 2021 23:36:28 -0700 Message-Id: <20210626063631.2411938-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210626063631.2411938-1-richard.henderson@linaro.org> References: <20210626063631.2411938-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.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(-) 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); -- 2.25.1