[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 73/84] target/hexagon/idef-parser: Use gen_constant for gen_extend
From: |
Richard Henderson |
Subject: |
[PULL 73/84] target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op |
Date: |
Sun, 5 Mar 2023 16:39:43 -0800 |
We already have a temporary, res, which we can use for the intermediate
shift result. Simplify the constant to -1 instead of 0xf*f.
This was the last use of gen_tmp_value, so remove it.
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hexagon/idef-parser/parser-helpers.c | 30 +++------------------
1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/target/hexagon/idef-parser/parser-helpers.c
b/target/hexagon/idef-parser/parser-helpers.c
index c0e6f2190c..e1a55412c8 100644
--- a/target/hexagon/idef-parser/parser-helpers.c
+++ b/target/hexagon/idef-parser/parser-helpers.c
@@ -305,26 +305,6 @@ HexValue gen_tmp(Context *c,
return rvalue;
}
-static HexValue gen_tmp_value(Context *c,
- YYLTYPE *locp,
- const char *value,
- unsigned bit_width,
- HexSignedness signedness)
-{
- HexValue rvalue;
- assert(bit_width == 32 || bit_width == 64);
- memset(&rvalue, 0, sizeof(HexValue));
- rvalue.type = TEMP;
- rvalue.bit_width = bit_width;
- rvalue.signedness = signedness;
- rvalue.is_dotnew = false;
- rvalue.tmp.index = c->inst.tmp_count;
- OUT(c, locp, "TCGv_i", &bit_width, " tmp_", &c->inst.tmp_count,
- " = tcg_const_i", &bit_width, "(", value, ");\n");
- c->inst.tmp_count++;
- return rvalue;
-}
-
static HexValue gen_constant_from_imm(Context *c,
YYLTYPE *locp,
HexValue *value)
@@ -1120,15 +1100,11 @@ static HexValue gen_extend_tcg_width_op(Context *c,
OUT(c, locp, "tcg_gen_subfi_i", &dst_width);
OUT(c, locp, "(", &shift, ", ", &dst_width, ", ", &src_width_m, ");\n");
if (signedness == UNSIGNED) {
- const char *mask_str = (dst_width == 32)
- ? "0xffffffff"
- : "0xffffffffffffffff";
- HexValue mask = gen_tmp_value(c, locp, mask_str,
- dst_width, UNSIGNED);
+ HexValue mask = gen_constant(c, locp, "-1", dst_width, UNSIGNED);
OUT(c, locp, "tcg_gen_shr_i", &dst_width, "(",
- &mask, ", ", &mask, ", ", &shift, ");\n");
+ &res, ", ", &mask, ", ", &shift, ");\n");
OUT(c, locp, "tcg_gen_and_i", &dst_width, "(",
- &res, ", ", value, ", ", &mask, ");\n");
+ &res, ", ", &res, ", ", value, ");\n");
} else {
OUT(c, locp, "tcg_gen_shl_i", &dst_width, "(",
&res, ", ", value, ", ", &shift, ");\n");
--
2.34.1
- [PULL 61/84] target/xtensa: Drop tcg_temp_free, (continued)
- [PULL 61/84] target/xtensa: Drop tcg_temp_free, Richard Henderson, 2023/03/05
- [PULL 62/84] target/i386: Drop tcg_temp_free, Richard Henderson, 2023/03/05
- [PULL 69/84] target/hexagon: Use tcg_constant_* for gen_constant_from_imm, Richard Henderson, 2023/03/05
- [PULL 68/84] docs/devel/tcg-ops: Drop recommendation to free temps, Richard Henderson, 2023/03/05
- [PULL 72/84] target/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred, Richard Henderson, 2023/03/05
- [PULL 46/84] target/microblaze: Drop tcg_temp_free, Richard Henderson, 2023/03/05
- [PULL 64/84] target/mips: Fix trans_mult_acc return, Richard Henderson, 2023/03/05
- [PULL 67/84] tracing: remove transform.py, Richard Henderson, 2023/03/05
- [PULL 71/84] target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign, Richard Henderson, 2023/03/05
- [PULL 76/84] target/riscv: Avoid tcg_const_*, Richard Henderson, 2023/03/05
- [PULL 73/84] target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op,
Richard Henderson <=
- [PULL 66/84] include/exec/gen-icount: Drop tcg_temp_free in gen_tb_start, Richard Henderson, 2023/03/05
- [PULL 74/84] target/i386: Simplify POPF, Richard Henderson, 2023/03/05
- [PULL 78/84] target/sparc: Avoid tcg_const_{tl,i32}, Richard Henderson, 2023/03/05
- [PULL 77/84] target/s390x: Split out gen_ri2, Richard Henderson, 2023/03/05
- [PULL 75/84] target/microblaze: Avoid tcg_const_* throughout, Richard Henderson, 2023/03/05
- [PULL 53/84] target/rx: Drop tcg_temp_free, Richard Henderson, 2023/03/05
- [PULL 56/84] target/sparc: Drop get_temp_i32, Richard Henderson, 2023/03/05
- [PULL 70/84] target/hexagon/idef-parser: Use gen_tmp for LPCFG, Richard Henderson, 2023/03/05
- [PULL 79/84] target/xtensa: Tidy translate_bb, Richard Henderson, 2023/03/05
- [PULL 80/84] target/xtensa: Tidy translate_clamps, Richard Henderson, 2023/03/05