From nobody Sat Nov 23 19:50:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731364225; cv=none; d=zohomail.com; s=zohoarc; b=XzGiX7lR3ojWzkeVfxkO4uApNuFVIILkzIovWih4N//+7E+qdxyO/i5NPHk9/KihynXog35PhzqgZX7zJdIIBERMx7sGwlj/gVFcN9RDZ4j/gdADQYHeepQI2+1kDQk83iaPz+b7eEfr7SWifBAU08Yj1KkizbiomASKrJJChZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731364225; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TDoaWsz0HSbM34lZB8eXf+Hk5GveTxSlbFqqIAwSB2Q=; b=Ud+vZic5dHTBztvCPSq0UG3flld5E0H4X1dh4C4BCSHk25Iqo4DSHpqXTNV5lUiJpLPbUOlIoeTKXzkiLzdCnmnJn1ac8mfFJtt4jJ42t4l2lLe596/zvz1UNlZ/hf/Yvyozr+1FEX6ZvXGm+mE2CJODUp+tH/iwaOya0X0LiRs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173136422577117.88661032225025; Mon, 11 Nov 2024 14:30:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAcut-0001HR-Ot; Mon, 11 Nov 2024 17:29:51 -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 1tAcur-0001H4-SD for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:29:49 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAcuq-0006jl-9s for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:29:49 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so47689285e9.1 for ; Mon, 11 Nov 2024 14:29:47 -0800 (PST) Received: from localhost.localdomain (vau06-h02-176-184-43-163.dsl.sta.abo.bbox.fr. [176.184.43.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432b053069fsm192795565e9.4.2024.11.11.14.29.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Nov 2024 14:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731364186; x=1731968986; 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=TDoaWsz0HSbM34lZB8eXf+Hk5GveTxSlbFqqIAwSB2Q=; b=gMap+KCJ0A5ADbdXO0oa+vaOFg9V2dOd5VPj/IMg3vSU6TsEaUr7YrTb/Y91QLGcOX aGyICdGL0nzdSZXIAXVD5UAD85q4AR8518f543Hw4Ggtg9LYYPH8UjVvX1qJw9kd0Ai6 K1BNth9YiFQxCrpnb5wUZnYSWjc8HI91NEgJAijTdhRr+Wl5NvikTrckBqsWc45aYqjY iOY6q30nco+0h4ZqW/GUHzrlTbdYwlORfBeuU5zuWcdUqqYZ/ObQAsTHuUjrM+5w7vD6 mf9UjT/23NDs5eptuF6EyG7w0i9s/1SyfIT8ERZM2EBoeLBm2A8C1+L8iTAg38+m6H49 4duw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731364186; x=1731968986; 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=TDoaWsz0HSbM34lZB8eXf+Hk5GveTxSlbFqqIAwSB2Q=; b=nA8xzViIGh3s1IqwwWNLiRziLXIsgtRDNaVCicw8Gdkuv/lYe06oA3257orODJSJ89 OweDsi2q7G0wo5ravdevu88qIf/ycVr0NF3FPD300+BmvR9+tuqnHSaqH196SYCOlvqQ bK44woIfl4Zw/LdaoQv2XvQIOfLRs1fiY7HsksLzoY7Bfn9UgxLpa32RdsIQK/Sbx7Gn hdghtgYYyL+USa3cSlIfvNYnnVQkjaZCMKAa9zjYoHqM/rzHBtEELyDXgzq8JHqWwbXl FKybt3GAj2ssjaMh3oHYr2KvQB7pPAeC12mAa9BqGEkFw/JFqvKiq7E7AVYp/qqBDfxk IXiw== X-Gm-Message-State: AOJu0YzhlBRkhA+SV8lmu83S22mxwDyC3MtIRbH9EidiTZbgjmVXIjlW DQgkkJaSTlsEf7RBWF0sGgRvfAMEln2myIJFAMa1uYGZmH8x3X7bhp7y5DmN2BFv3OSNr88ZNuz N X-Google-Smtp-Source: AGHT+IGNWZKoEH5oOIR5a+4FlZebhVDK+28uM7H0C2/eWFJjtnMLm9vbEhcELQzP2f5RLtcrEjIHqw== X-Received: by 2002:a05:600c:5124:b0:431:46fe:4cad with SMTP id 5b1f17b1804b1-432b7501d4emr128829905e9.9.1731364186548; Mon, 11 Nov 2024 14:29:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Pavel Dovgalyuk Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 1/3] target/mips: Extract gen_base_index_addr() helper Date: Mon, 11 Nov 2024 23:29:34 +0100 Message-ID: <20241111222936.59869-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111222936.59869-1-philmd@linaro.org> References: <20241111222936.59869-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731364230675116600 Factor out gen_base_index_addr() which is used twice but we'll use it more. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/tcg/translate.h | 1 + target/mips/tcg/translate.c | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index 1bf153d183..ed69ba15e5 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -153,6 +153,7 @@ void check_cp1_registers(DisasContext *ctx, int regs); void check_cop1x(DisasContext *ctx); =20 void gen_base_offset_addr(DisasContext *ctx, TCGv addr, int base, int offs= et); +void gen_base_index_addr(DisasContext *ctx, TCGv addr, int base, int index= ); void gen_move_low32(TCGv ret, TCGv_i64 arg); void gen_move_high32(TCGv ret, TCGv_i64 arg); void gen_load_gpr(TCGv t, int reg); diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index de7045874d..7152f5418e 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1956,6 +1956,17 @@ void gen_base_offset_addr(DisasContext *ctx, TCGv ad= dr, int base, int offset) } } =20 +void gen_base_index_addr(DisasContext *ctx, TCGv addr, int base, int index) +{ + if (base =3D=3D 0) { + gen_load_gpr(addr, index); + } else if (index =3D=3D 0) { + gen_load_gpr(addr, base); + } else { + gen_op_addr_add(ctx, addr, cpu_gpr[base], cpu_gpr[index]); + } +} + static target_ulong pc_relative_pc(DisasContext *ctx) { target_ulong pc =3D ctx->base.pc_next; @@ -10545,13 +10556,7 @@ static void gen_flt3_ldst(DisasContext *ctx, uint3= 2_t opc, { TCGv t0 =3D tcg_temp_new(); =20 - if (base =3D=3D 0) { - gen_load_gpr(t0, index); - } else if (index =3D=3D 0) { - gen_load_gpr(t0, base); - } else { - gen_op_addr_add(ctx, t0, cpu_gpr[base], cpu_gpr[index]); - } + gen_base_index_addr(ctx, t0, base, index); /* * Don't do NOP if destination is zero: we must perform the actual * memory access. @@ -11333,13 +11338,7 @@ static void gen_mips_lx(DisasContext *ctx, uint32_= t opc, } t0 =3D tcg_temp_new(); =20 - if (base =3D=3D 0) { - gen_load_gpr(t0, offset); - } else if (offset =3D=3D 0) { - gen_load_gpr(t0, base); - } else { - gen_op_addr_add(ctx, t0, cpu_gpr[base], cpu_gpr[offset]); - } + gen_base_index_addr(ctx, t0, base, offset); =20 switch (opc) { case OPC_LBUX: --=20 2.45.2 From nobody Sat Nov 23 19:50:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731364255; cv=none; d=zohomail.com; s=zohoarc; b=GV+/iPMT0hCJt79B66Bqa/DaMLhZ4XJoF3UiG4AIgArLZ+B/enPdQwcrepz5WZYSRnxqa534ASTfCRVQnkmxRe3QunTryaPqeKJn7H0delaC/8sgUL27gR7+HCJ28WH7o1pC/U6X260Sllj/TMSDz9tOGA6OG9zwc/bNGsCY7xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731364255; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0AKRwDlBDWBLPaBtzDp9aTzEOum/fHmH3izgoL0EAGM=; b=H95z3X3QKVyGs0APtUg87gx64Zosv4OZYv/PbruKOoWdVxTZVxgWyNKNWbtkd2kQQAsejmdDI5i9FTFL9IMDBls0zPdUaOyy14uydY3L3TYGgpXtQN0yOBauyGr5Qzo/nmfRFRoeSwdDAtemjEjkAkbeZjC7q3Op+DOYsmKGANQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731364255956239.1107603271961; Mon, 11 Nov 2024 14:30:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAcv3-0001IP-5a; Mon, 11 Nov 2024 17:30:01 -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 1tAcv0-0001I1-Ln for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:29:58 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAcuz-0006lK-1F for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:29:58 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4315eeb2601so63245405e9.2 for ; Mon, 11 Nov 2024 14:29:56 -0800 (PST) Received: from localhost.localdomain (vau06-h02-176-184-43-163.dsl.sta.abo.bbox.fr. [176.184.43.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa73886bsm222637815e9.39.2024.11.11.14.29.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Nov 2024 14:29:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731364194; x=1731968994; 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=0AKRwDlBDWBLPaBtzDp9aTzEOum/fHmH3izgoL0EAGM=; b=i/Y5NAVugXYWf6zTanGZY4wfLqr342vT8ZaO/WxsDdlzBjRXR62nk+m8iSlSJIeW9l xkgg9LkyZuQ3amr5bRWPh/GFh6+O9ZljJ9B+z+14COoTqwIVn+YxKttfkjJOwO/U33Uq aO9GQ11UeTz/QqTdFaF+DNaqlsWs0YcO7XACGo3AfhgrkcLbX9yMudkJIYtNdKi6I2+n wYOzoQCMAPSVtjvJcsbbQn8EnZuOwgkQ5fiE5zTNBV9a/bakXcTe6DL4LzUB4F8L2MKj ive1/pvNKkNqQYCnpSL37ePTXR7t2FBfIThyLFXvQl5ytLxmohsANTldN5DsS15+/buP JKLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731364194; x=1731968994; 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=0AKRwDlBDWBLPaBtzDp9aTzEOum/fHmH3izgoL0EAGM=; b=kN54WXh6W2978Z2XCkRpcdiXMkpEHSda7TZmaTOLPUb/8XWXAeALqCFGtXy6U4/rET /JAoKfRwKMYnNb+PUlLAFV81Rdt/7TwYdQRaLT+YRbExCC2YzSAiLxBB1/eBRPDPKIw+ SIWC2e/01dhlmlY3PxNQkqHve5XqfdWWELuJ3vGeT0Hb8Z/AnaX8Y2B519PsRo6r8uaM 9ngHrkSCL6k2hGz7VQuwG90o4DyQW537Dac0zR8WZ8yWruUw5k45ZlegMFDJLLzCC1Kn xC8EMEpGS1En9gA/bIE78PTkLCL5J5uZ4d7ekMaJGjE18NCdIGeFP2F3tWTKntnjtEBT 2zHA== X-Gm-Message-State: AOJu0YyQZim8EPMqeNEwwezNLJYfkgniA5TeqRHpMGQSqVQckRfLD4BR BxOaJttwjNn4EGIEoOIo4VHZriHEPIuk+eErAO3rQl/HAy3KQRfiUrQr/RtNeyc8PyqIUZEap/q g X-Google-Smtp-Source: AGHT+IFdKittLDMKVPt38ODhsFkQZjFlHlPHMRyrfC5AY5rB34nCWOZtJtQ+wt2hwDlT+Ych2FEVPA== X-Received: by 2002:a05:600c:3146:b0:42c:b508:750e with SMTP id 5b1f17b1804b1-432b750584amr144432835e9.11.1731364193663; Mon, 11 Nov 2024 14:29:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Pavel Dovgalyuk Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 2/3] target/mips: Extract generic gen_lx() helper Date: Mon, 11 Nov 2024 23:29:35 +0100 Message-ID: <20241111222936.59869-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111222936.59869-1-philmd@linaro.org> References: <20241111222936.59869-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731364258759116600 Extract gen_lx() from gen_mips_lx(); inline the Octeon check in decode_opc_special3_legacy(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/mips/tcg/translate.h | 1 + target/mips/tcg/translate.c | 55 +++++++++++++------------------------ 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index ed69ba15e5..a65ab4a747 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -168,6 +168,7 @@ void gen_store_fpr32(DisasContext *ctx, TCGv_i32 t, int= reg); void gen_store_fpr64(DisasContext *ctx, TCGv_i64 t, int reg); int get_fp_bit(int cc); =20 +void gen_lx(DisasContext *ctx, int rd, int base, int index, MemOp mop); void gen_ldxs(DisasContext *ctx, int base, int index, int rd); void gen_align(DisasContext *ctx, int wordsz, int rd, int rs, int rt, int = bp); void gen_addiupc(DisasContext *ctx, int rx, int imm, diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 7152f5418e..acadd3d891 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -2035,6 +2035,15 @@ static void gen_lxr(DisasContext *ctx, TCGv reg, TCG= v addr, tcg_gen_or_tl(reg, t0, t1); } =20 +void gen_lx(DisasContext *ctx, int rd, int base, int index, MemOp mop) +{ + TCGv t0 =3D tcg_temp_new(); + + gen_base_index_addr(ctx, t0, base, index); + tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, mo_endian(ctx) | mop); + gen_store_gpr(t0, rd); +} + /* Load */ static void gen_ld(DisasContext *ctx, uint32_t opc, int rt, int base, int offset) @@ -11327,41 +11336,6 @@ enum { =20 /* MIPSDSP functions. */ =20 -/* Indexed load is not for DSP only */ -static void gen_mips_lx(DisasContext *ctx, uint32_t opc, - int rd, int base, int offset) -{ - TCGv t0; - - if (!(ctx->insn_flags & INSN_OCTEON)) { - check_dsp(ctx); - } - t0 =3D tcg_temp_new(); - - gen_base_index_addr(ctx, t0, base, offset); - - switch (opc) { - case OPC_LBUX: - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_UB); - gen_store_gpr(t0, rd); - break; - case OPC_LHX: - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, mo_endian(ctx) | MO_SW); - gen_store_gpr(t0, rd); - break; - case OPC_LWX: - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, mo_endian(ctx) | MO_SL); - gen_store_gpr(t0, rd); - break; -#if defined(TARGET_MIPS64) - case OPC_LDX: - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, mo_endian(ctx) | MO_UQ); - gen_store_gpr(t0, rd); - break; -#endif - } -} - static void gen_mipsdsp_arith(DisasContext *ctx, uint32_t op1, uint32_t op= 2, int ret, int v1, int v2) { @@ -13609,15 +13583,24 @@ static void decode_opc_special3_legacy(CPUMIPSSta= te *env, DisasContext *ctx) } break; case OPC_LX_DSP: + if (!(ctx->insn_flags & INSN_OCTEON)) { + check_dsp(ctx); + } op2 =3D MASK_LX(ctx->opcode); switch (op2) { #if defined(TARGET_MIPS64) case OPC_LDX: + gen_lx(ctx, rd, rs, rt, MO_UQ); + break; #endif case OPC_LBUX: + gen_lx(ctx, rd, rs, rt, MO_UB); + break; case OPC_LHX: + gen_lx(ctx, rd, rs, rt, MO_SW); + break; case OPC_LWX: - gen_mips_lx(ctx, op2, rd, rs, rt); + gen_lx(ctx, rd, rs, rt, MO_SL); break; default: /* Invalid */ MIPS_INVAL("MASK LX"); --=20 2.45.2 From nobody Sat Nov 23 19:50:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731364237; cv=none; d=zohomail.com; s=zohoarc; b=FSrKLw2Myk30FIHXLgsfXivT/mvziS2sT8Rw+yCBCIil4rFFViRuQoTdKUD8H91sIZGSNjX0gpyFf1tLdFszSaAlA7VJnl+aGn+RY/6xh4t6zuF8X43EWU1g38ErbHmeGdVUc1VWUtGftOu0WJotjAfn0ulnIYQmBMRAeFxM9RY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731364237; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VSttJJCIDI0nTQHLmARnxM4Mg6vxyxH9JmxDQ+jh1mM=; b=bXhCtdCSbDoJh6wq5hEmV9Ywe4ZdrKWyasizYESDiq+BX4CFzesl42qSSKL/TmMRDwcC7Q37uEZV5BRAShcjdnEdVGaM0TAnGPhbJU/wTtVjqKLVjDDCkFrNZCIzpJyA/7mvxP2EZgIcyBiZv7bEl/VwX5Upujt5/iS6yHGPaxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173136423741519.75563328675048; Mon, 11 Nov 2024 14:30:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAcv6-0001Jg-Fc; Mon, 11 Nov 2024 17:30:04 -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 1tAcv4-0001J1-EC for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:30:02 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAcv2-0006lo-Qj for qemu-devel@nongnu.org; Mon, 11 Nov 2024 17:30:02 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4315e9e9642so41327745e9.0 for ; Mon, 11 Nov 2024 14:30:00 -0800 (PST) Received: from localhost.localdomain (vau06-h02-176-184-43-163.dsl.sta.abo.bbox.fr. [176.184.43.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432b04753d5sm196543195e9.0.2024.11.11.14.29.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Nov 2024 14:29:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731364199; x=1731968999; 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=VSttJJCIDI0nTQHLmARnxM4Mg6vxyxH9JmxDQ+jh1mM=; b=D2Mn7iSsp0C+ot4drl3B5b1g+76uGKh0HN1h5QUqwlKVOvvmFEfAoYYo2duxEL18hk YAp2ebzkCbTTVL7AN625Jxu975xgH4OnELTMCdKBmp8Z2KdShNesUAqMbzc31OAyQWuX qwTVhEMBsSjv11wtxRSd1KwpDGioj4qbSdO2L2aXHwTn30Us1SNK2pOoHUOkA5C58Fu1 kV64Nzm6KbFuSGjYNMsWEi+4V3LmgdewLnZlbNmQ6O1pXMWbD+aQtYmYZvifC3sIllFc DjrKokMrvxVozVhQDLhRXZS5HkW6MqSJ08rVLbqgvFRI2P21/l2W6EsaIdhfOwdojuqR o19Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731364199; x=1731968999; 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=VSttJJCIDI0nTQHLmARnxM4Mg6vxyxH9JmxDQ+jh1mM=; b=Pm0pwzhBEsZRWs2/p+C4fwjKoLY4+E01aCaTNvmcAd2xv9Xc2QLWd66kkqRUqB3wB/ V/GKp8HElUDoz/h1nvbPlLvVQUaTmNFrnbAFzM1AnieYFAtQ6c9mrkbTJ4i5MHWVNDug A/zd6KB54s2Ab71+1hRWxltAclnBexarNL9Loxj7/5hbJGafMCA07UrseNkHnMem6gbx j8vk4V8UGZNEPWdjfsPqkiVDdbOur6eBVMkuAUUJgxyOfp0GjMKI+Inx0ifty05mXbur aCwhyMkOjCY8oAP61xfS2GJUElh90wLHAMdMeXcUnglt3xaFbmcTqiNCGcqejfHhp5tJ l+ww== X-Gm-Message-State: AOJu0YzlhbNgqwmddTT9EE5O6iwmkv3hfA93c42B4WyfajHAz+W6Aey8 AA7dsS5cU9g/8ofbhEF3IRf8eVdIVYIyqeUBVP64Lic1nWLfsKrLyolNFKaaaZ1P7uRKJUQ2hp/ Y X-Google-Smtp-Source: AGHT+IEn2pnqAPFycJ4S+WhRfqPpwsKT3K1I7wHp56tm5sznc9wRCTJpraab9LD1mtE99eaMeayLuQ== X-Received: by 2002:a05:600c:1d20:b0:431:6060:8b16 with SMTP id 5b1f17b1804b1-432b751ceb4mr115355925e9.30.1731364199046; Mon, 11 Nov 2024 14:29:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Pavel Dovgalyuk Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 3/3] target/mips: Convert Octeon LX instructions to decodetree Date: Mon, 11 Nov 2024 23:29:36 +0100 Message-ID: <20241111222936.59869-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111222936.59869-1-philmd@linaro.org> References: <20241111222936.59869-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731364238485116600 Use Octeon decodetree to call gen_lx() for the LX instructions. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson --- target/mips/tcg/octeon.decode | 8 ++++++++ target/mips/tcg/octeon_translate.c | 12 ++++++++++++ target/mips/tcg/translate.c | 4 +--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode index 0c787cb498..102a05860d 100644 --- a/target/mips/tcg/octeon.decode +++ b/target/mips/tcg/octeon.decode @@ -1,6 +1,7 @@ # Octeon Architecture Module instruction set # # Copyright (C) 2022 Pavel Dovgalyuk +# Copyright (C) 2024 Philippe Mathieu-Daud=C3=A9 # # SPDX-License-Identifier: LGPL-2.1-or-later # @@ -39,3 +40,10 @@ CINS 011100 ..... ..... ..... ..... 11001 . @bit= field POP 011100 rs:5 00000 rd:5 00000 10110 dw:1 SEQNE 011100 rs:5 rt:5 rd:5 00000 10101 ne:1 SEQNEI 011100 rs:5 rt:5 imm:s10 10111 ne:1 + +&lx base index rd +@lx ...... base:5 index:5 rd:5 ...... ..... &lx +LWX 011111 ..... ..... ..... 00000 001010 @lx +LHX 011111 ..... ..... ..... 00100 001010 @lx +LBUX 011111 ..... ..... ..... 00110 001010 @lx +LDX 011111 ..... ..... ..... 01000 001010 @lx diff --git a/target/mips/tcg/octeon_translate.c b/target/mips/tcg/octeon_tr= anslate.c index e25c4cbaa0..0e0b00303a 100644 --- a/target/mips/tcg/octeon_translate.c +++ b/target/mips/tcg/octeon_translate.c @@ -174,3 +174,15 @@ static bool trans_SEQNEI(DisasContext *ctx, arg_SEQNEI= *a) } return true; } + +static bool trans_lx(DisasContext *ctx, arg_lx *a, MemOp mop) +{ + gen_lx(ctx, a->rd, a->base, a->index, mop); + + return true; +} + +TRANS(LBUX, trans_lx, MO_UB); +TRANS(LHX, trans_lx, MO_SW); +TRANS(LWX, trans_lx, MO_SL); +TRANS(LDX, trans_lx, MO_UQ); diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index acadd3d891..6fd5462a24 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -13583,9 +13583,7 @@ static void decode_opc_special3_legacy(CPUMIPSState= *env, DisasContext *ctx) } break; case OPC_LX_DSP: - if (!(ctx->insn_flags & INSN_OCTEON)) { - check_dsp(ctx); - } + check_dsp(ctx); op2 =3D MASK_LX(ctx->opcode); switch (op2) { #if defined(TARGET_MIPS64) --=20 2.45.2