diff options
author | Taylor Simpson <tsimpson@quicinc.com> | 2022-11-08 08:28:56 -0800 |
---|---|---|
committer | Taylor Simpson <tsimpson@quicinc.com> | 2022-12-16 10:10:28 -0800 |
commit | 1e536334ccb0a1606f814a38a4996b3b818e9fab (patch) | |
tree | 6f2eef486fda1a451a808ca415d217ea587130c0 /target/hexagon/gen_tcg_funcs.py | |
parent | 4208e6ae114ac8266dcacc9696a443ce5c37b04e (diff) |
Hexagon (target/hexagon) Add pkt and insn to DisasContext
This enables us to reduce the number of parameters to many functions
In particular, the generated functions previously took all 3 as arguments
Not only does this simplify the code, it improves the translation time
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <20221108162906.3166-2-tsimpson@quicinc.com>
Diffstat (limited to 'target/hexagon/gen_tcg_funcs.py')
-rwxr-xr-x | target/hexagon/gen_tcg_funcs.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs.py index 6dea02b0b9..02a6565685 100755 --- a/target/hexagon/gen_tcg_funcs.py +++ b/target/hexagon/gen_tcg_funcs.py @@ -561,11 +561,7 @@ def genptr_dst_write_opn(f,regtype, regid, tag): ## Generate the TCG code to call the helper ## For A2_add: Rd32=add(Rs32,Rt32), { RdV=RsV+RtV;} ## We produce: -## static void generate_A2_add() -## CPUHexagonState *env -## DisasContext *ctx, -## Insn *insn, -## Packet *pkt) +## static void generate_A2_add(DisasContext *ctx) ## { ## TCGv RdV = tcg_temp_local_new(); ## const int RdN = insn->regno[0]; @@ -584,12 +580,11 @@ def genptr_dst_write_opn(f,regtype, regid, tag): ## <GEN> is gen_helper_A2_add(RdV, cpu_env, RsV, RtV); ## def gen_tcg_func(f, tag, regs, imms): - f.write("static void generate_%s(\n" %tag) - f.write(" CPUHexagonState *env,\n") - f.write(" DisasContext *ctx,\n") - f.write(" Insn *insn,\n") - f.write(" Packet *pkt)\n") + f.write("static void generate_%s(DisasContext *ctx)\n" %tag) f.write('{\n') + + f.write(" Insn *insn __attribute__((unused)) = ctx->insn;\n") + if hex_common.need_ea(tag): gen_decl_ea_tcg(f, tag) i=0 ## Declare all the operands (regs and immediates) |