mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
target/Hexagon: Finish conversion to tcg_gen_qemu_{ld, st}_*
Convert away from the old interface with the implicit MemOp argument. Importantly, this removes some incorrect casts generated by idef-parser's gen_load(). Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Anton Johansson <anjo@rev.ng> Message-Id: <20230502135741.1158035-4-richard.henderson@linaro.org>
This commit is contained in:
parent
a9a9c3fa6f
commit
53b26d253c
4 changed files with 40 additions and 42 deletions
|
@ -1737,36 +1737,34 @@ void gen_load_cancel(Context *c, YYLTYPE *locp)
|
|||
void gen_load(Context *c, YYLTYPE *locp, HexValue *width,
|
||||
HexSignedness signedness, HexValue *ea, HexValue *dst)
|
||||
{
|
||||
char size_suffix[4] = {0};
|
||||
const char *sign_suffix;
|
||||
unsigned dst_bit_width;
|
||||
unsigned src_bit_width;
|
||||
|
||||
/* Memop width is specified in the load macro */
|
||||
assert_signedness(c, locp, signedness);
|
||||
sign_suffix = (width->imm.value > 4)
|
||||
? ""
|
||||
: ((signedness == UNSIGNED) ? "u" : "s");
|
||||
|
||||
/* If dst is a variable, assert that is declared and load the type info */
|
||||
if (dst->type == VARID) {
|
||||
find_variable(c, locp, dst, dst);
|
||||
}
|
||||
|
||||
snprintf(size_suffix, 4, "%" PRIu64, width->imm.value * 8);
|
||||
src_bit_width = width->imm.value * 8;
|
||||
dst_bit_width = MAX(dst->bit_width, 32);
|
||||
|
||||
/* Lookup the effective address EA */
|
||||
find_variable(c, locp, ea, ea);
|
||||
OUT(c, locp, "if (insn->slot == 0 && pkt->pkt_has_store_s1) {\n");
|
||||
OUT(c, locp, "probe_noshuf_load(", ea, ", ", width, ", ctx->mem_idx);\n");
|
||||
OUT(c, locp, "process_store(ctx, 1);\n");
|
||||
OUT(c, locp, "}\n");
|
||||
OUT(c, locp, "tcg_gen_qemu_ld", size_suffix, sign_suffix);
|
||||
|
||||
OUT(c, locp, "tcg_gen_qemu_ld_i", &dst_bit_width);
|
||||
OUT(c, locp, "(");
|
||||
if (dst->bit_width > width->imm.value * 8) {
|
||||
/*
|
||||
* Cast to the correct TCG type if necessary, to avoid implict cast
|
||||
* warnings. This is needed when the width of the destination var is
|
||||
* larger than the size of the requested load.
|
||||
*/
|
||||
OUT(c, locp, "(TCGv) ");
|
||||
OUT(c, locp, dst, ", ", ea, ", ctx->mem_idx, MO_", &src_bit_width);
|
||||
if (signedness == SIGNED) {
|
||||
OUT(c, locp, " | MO_SIGN");
|
||||
}
|
||||
OUT(c, locp, dst, ", ", ea, ", ctx->mem_idx);\n");
|
||||
OUT(c, locp, " | MO_TE);\n");
|
||||
}
|
||||
|
||||
void gen_store(Context *c, YYLTYPE *locp, HexValue *width, HexValue *ea,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue