target/hexagon: Use tcg_constant_* for gen_constant_from_imm

Rename from gen_tmp_value_from_imm to match gen_constant vs gen_tmp.

Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2023-02-26 16:19:36 -10:00
parent 8a0816d6be
commit 2c3cee6bd7
1 changed files with 7 additions and 8 deletions

View File

@ -325,9 +325,9 @@ HexValue gen_tmp_value(Context *c,
return rvalue; return rvalue;
} }
static HexValue gen_tmp_value_from_imm(Context *c, static HexValue gen_constant_from_imm(Context *c,
YYLTYPE *locp, YYLTYPE *locp,
HexValue *value) HexValue *value)
{ {
HexValue rvalue; HexValue rvalue;
assert(value->type == IMMEDIATE); assert(value->type == IMMEDIATE);
@ -338,11 +338,11 @@ static HexValue gen_tmp_value_from_imm(Context *c,
rvalue.is_dotnew = false; rvalue.is_dotnew = false;
rvalue.tmp.index = c->inst.tmp_count; rvalue.tmp.index = c->inst.tmp_count;
/* /*
* Here we output the call to `tcg_const_i<width>` in * Here we output the call to `tcg_constant_i<width>` in
* order to create the temporary value. Note, that we * order to create the temporary value. Note, that we
* add a cast * add a cast
* *
* `tcg_const_i<width>`((int<width>_t) ...)` * `tcg_constant_i<width>`((int<width>_t) ...)`
* *
* This cast is required to avoid implicit integer * This cast is required to avoid implicit integer
* conversion warnings since all immediates are * conversion warnings since all immediates are
@ -350,7 +350,7 @@ static HexValue gen_tmp_value_from_imm(Context *c,
* integer is 32-bit. * integer is 32-bit.
*/ */
OUT(c, locp, "TCGv_i", &rvalue.bit_width, " tmp_", &c->inst.tmp_count); OUT(c, locp, "TCGv_i", &rvalue.bit_width, " tmp_", &c->inst.tmp_count);
OUT(c, locp, " = tcg_const_i", &rvalue.bit_width, OUT(c, locp, " = tcg_constant_i", &rvalue.bit_width,
"((int", &rvalue.bit_width, "_t) (", value, "));\n"); "((int", &rvalue.bit_width, "_t) (", value, "));\n");
c->inst.tmp_count++; c->inst.tmp_count++;
@ -395,8 +395,7 @@ HexValue gen_imm_qemu_tmp(Context *c, YYLTYPE *locp, unsigned bit_width,
HexValue rvalue_materialize(Context *c, YYLTYPE *locp, HexValue *rvalue) HexValue rvalue_materialize(Context *c, YYLTYPE *locp, HexValue *rvalue)
{ {
if (rvalue->type == IMMEDIATE) { if (rvalue->type == IMMEDIATE) {
HexValue res = gen_tmp_value_from_imm(c, locp, rvalue); return gen_constant_from_imm(c, locp, rvalue);
return res;
} }
return *rvalue; return *rvalue;
} }