[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 36/81] tcg/aarch64: Expand extract with offset 0 with andi
From: |
Richard Henderson |
Subject: |
[PATCH v2 36/81] tcg/aarch64: Expand extract with offset 0 with andi |
Date: |
Tue, 7 Jan 2025 00:00:27 -0800 |
We're about to change canonicalization of masks as extract
instead of and. Retain the andi expansion here.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/aarch64/tcg-target.c.inc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
index ede6f47235..66eb4b73b5 100644
--- a/tcg/aarch64/tcg-target.c.inc
+++ b/tcg/aarch64/tcg-target.c.inc
@@ -2450,7 +2450,12 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
TCGType ext,
case INDEX_op_extract_i64:
case INDEX_op_extract_i32:
- tcg_out_ubfm(s, ext, a0, a1, a2, a2 + args[3] - 1);
+ if (a2 == 0) {
+ uint64_t mask = MAKE_64BIT_MASK(0, args[3]);
+ tcg_out_logicali(s, I3404_ANDI, ext, a0, a1, mask);
+ } else {
+ tcg_out_ubfm(s, ext, a0, a1, a2, a2 + args[3] - 1);
+ }
break;
case INDEX_op_sextract_i64:
--
2.43.0
- [PATCH v2 29/81] tcg: Remove TCG_OPF_64BIT, (continued)
- [PATCH v2 29/81] tcg: Remove TCG_OPF_64BIT, Richard Henderson, 2025/01/07
- [PATCH v2 32/81] tcg/mips: Expand bswap unconditionally, Richard Henderson, 2025/01/07
- [PATCH v2 31/81] tcg: Replace IMPLVEC with TCG_OPF_VECTOR, Richard Henderson, 2025/01/07
- [PATCH v2 34/81] tcg/i386: Fold the ext{8, 16, 32}[us] cases into {s}extract, Richard Henderson, 2025/01/07
- [PATCH v2 35/81] tcg/aarch64: Provide TCG_TARGET_{s}extract_valid, Richard Henderson, 2025/01/07
- [PATCH v2 36/81] tcg/aarch64: Expand extract with offset 0 with andi,
Richard Henderson <=
- [PATCH v2 38/81] tcg/loongarch64: Fold the ext{8, 16, 32}[us] cases into {s}extract, Richard Henderson, 2025/01/07
- [PATCH v2 12/81] target/i386: Use tcg_op_deposit_valid, Richard Henderson, 2025/01/07
- [PATCH v2 27/81] tcg: Pass type and flags to tcg_target_op_def, Richard Henderson, 2025/01/07
- [PATCH v2 30/81] tcg: Drop implementation checks from tcg-opc.h, Richard Henderson, 2025/01/07
- [PATCH v2 37/81] tcg/arm: Add full [US]XT[BH] into {s}extract, Richard Henderson, 2025/01/07