From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Anton Johansson" <anjo@rev.ng>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Stafford Horne" <shorne@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 08/10] target/openrisc: Remove 'TARGET_LONG_BITS != 32' dead code
Date: Thu, 9 Oct 2025 10:19:00 +0200 [thread overview]
Message-ID: <20251009081903.13426-9-philmd@linaro.org> (raw)
In-Reply-To: <20251009081903.13426-1-philmd@linaro.org>
The OpenRISC targets are only built as 32-bit:
$ git grep TARGET_LONG_BITS configs/targets/or1k-*
configs/targets/or1k-linux-user.mak:5:TARGET_LONG_BITS=32
configs/targets/or1k-softmmu.mak:5:TARGET_LONG_BITS=32
Remove the dead code guarded within TARGET_LONG_BITS != 32.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/openrisc/translate.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index 06625367ae4..dd93cfd6074 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -298,19 +298,8 @@ static void gen_muld(DisasContext *dc, TCGv srca, TCGv srcb)
tcg_gen_ext_tl_i64(t1, srca);
tcg_gen_ext_tl_i64(t2, srcb);
- if (TARGET_LONG_BITS == 32) {
- tcg_gen_mul_i64(cpu_mac, t1, t2);
- tcg_gen_movi_tl(cpu_sr_ov, 0);
- } else {
- TCGv_i64 high = tcg_temp_new_i64();
-
- tcg_gen_muls2_i64(cpu_mac, high, t1, t2);
- tcg_gen_sari_i64(t1, cpu_mac, 63);
- tcg_gen_negsetcond_i64(TCG_COND_NE, t1, t1, high);
- tcg_gen_trunc_i64_tl(cpu_sr_ov, t1);
-
- gen_ove_ov(dc);
- }
+ tcg_gen_mul_i64(cpu_mac, t1, t2);
+ tcg_gen_movi_tl(cpu_sr_ov, 0);
}
static void gen_muldu(DisasContext *dc, TCGv srca, TCGv srcb)
@@ -320,18 +309,8 @@ static void gen_muldu(DisasContext *dc, TCGv srca, TCGv srcb)
tcg_gen_extu_tl_i64(t1, srca);
tcg_gen_extu_tl_i64(t2, srcb);
- if (TARGET_LONG_BITS == 32) {
- tcg_gen_mul_i64(cpu_mac, t1, t2);
- tcg_gen_movi_tl(cpu_sr_cy, 0);
- } else {
- TCGv_i64 high = tcg_temp_new_i64();
-
- tcg_gen_mulu2_i64(cpu_mac, high, t1, t2);
- tcg_gen_setcondi_i64(TCG_COND_NE, high, high, 0);
- tcg_gen_trunc_i64_tl(cpu_sr_cy, high);
-
- gen_ove_cy(dc);
- }
+ tcg_gen_mul_i64(cpu_mac, t1, t2);
+ tcg_gen_movi_tl(cpu_sr_cy, 0);
}
static void gen_mac(DisasContext *dc, TCGv srca, TCGv srcb)
@@ -349,11 +328,7 @@ static void gen_mac(DisasContext *dc, TCGv srca, TCGv srcb)
tcg_gen_xor_i64(t1, t1, cpu_mac);
tcg_gen_andc_i64(t1, t1, t2);
-#if TARGET_LONG_BITS == 32
tcg_gen_extrh_i64_i32(cpu_sr_ov, t1);
-#else
- tcg_gen_mov_i64(cpu_sr_ov, t1);
-#endif
gen_ove_ov(dc);
}
--
2.51.0
next prev parent reply other threads:[~2025-10-09 8:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 8:18 [PATCH v2 00/10] target/openrisc: Remove all uses of target_[u]long types Philippe Mathieu-Daudé
2025-10-09 8:18 ` [PATCH v2 01/10] target/openrisc: Replace VMSTATE_UINTTL() -> VMSTATE_UINT32() Philippe Mathieu-Daudé
2025-10-09 16:41 ` Richard Henderson
2025-10-09 8:18 ` [PATCH v2 02/10] target/openrisc: Explode MO_TExx -> MO_TE | MO_xx Philippe Mathieu-Daudé
2025-10-09 16:43 ` Richard Henderson
2025-10-10 6:56 ` Philippe Mathieu-Daudé
2025-10-09 8:18 ` [PATCH v2 03/10] target/openrisc: Replace MO_TE -> MO_BE Philippe Mathieu-Daudé
2025-10-09 9:19 ` Philippe Mathieu-Daudé
2025-10-09 8:18 ` [PATCH v2 04/10] target/openrisc: Do not use target_ulong for @mr in MTSPR helper Philippe Mathieu-Daudé
2025-10-09 16:45 ` Richard Henderson
2025-10-09 8:18 ` [PATCH v2 05/10] target/openrisc: Remove unused cpu_openrisc_map_address_*() handlers Philippe Mathieu-Daudé
2025-10-09 16:47 ` Richard Henderson
2025-10-09 8:18 ` [PATCH v2 06/10] target/openrisc: Remove target_ulong use in raise_mmu_exception() Philippe Mathieu-Daudé
2025-10-09 16:48 ` Richard Henderson
2025-10-09 8:18 ` [PATCH v2 07/10] target/openrisc: Use vaddr type for $pc jumps Philippe Mathieu-Daudé
2025-10-09 16:49 ` Richard Henderson
2025-10-09 8:19 ` Philippe Mathieu-Daudé [this message]
2025-10-09 16:50 ` [PATCH v2 08/10] target/openrisc: Remove 'TARGET_LONG_BITS != 32' dead code Richard Henderson
2025-10-09 8:19 ` [PATCH v2 09/10] target/openrisc: Inline tcg_gen_trunc_i64_tl() Philippe Mathieu-Daudé
2025-10-09 16:50 ` Richard Henderson
2025-10-09 8:19 ` [PATCH v2 10/10] target/openrisc: Replace target_ulong -> uint32_t Philippe Mathieu-Daudé
2025-10-09 16:52 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251009081903.13426-9-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=anjo@rev.ng \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shorne@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).