aboutsummaryrefslogtreecommitdiff
path: root/target/hexagon/gen_tcg_funcs.py
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-02-24 18:33:03 -1000
committerRichard Henderson <richard.henderson@linaro.org>2023-03-05 13:44:07 -0800
commit6bf4bbc1c8725de55a1de57936a464c699809592 (patch)
tree2678b2cc20f055e966a9b2ed97e8d8b2994495f9 /target/hexagon/gen_tcg_funcs.py
parent09538b08c4ea4ce3c6f95cd2af2feacf60c23ba6 (diff)
target/hexagon: Drop tcg_temp_free from gen_tcg_funcs.py
Translators are no longer required to free tcg temporaries. Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hexagon/gen_tcg_funcs.py')
-rwxr-xr-xtarget/hexagon/gen_tcg_funcs.py79
1 files changed, 1 insertions, 78 deletions
diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs.py
index dfc90712fb..02cb52c21e 100755
--- a/target/hexagon/gen_tcg_funcs.py
+++ b/target/hexagon/gen_tcg_funcs.py
@@ -26,10 +26,7 @@ import hex_common
## Helpers for gen_tcg_func
##
def gen_decl_ea_tcg(f, tag):
- f.write(" TCGv EA = tcg_temp_new();\n")
-
-def gen_free_ea_tcg(f):
- f.write(" tcg_temp_free(EA);\n")
+ f.write(" TCGv EA G_GNUC_UNUSED = tcg_temp_new();\n")
def genptr_decl_pair_writable(f, tag, regtype, regid, regno):
regN="%s%sN" % (regtype,regid)
@@ -269,73 +266,6 @@ def genptr_decl_imm(f,immlett):
f.write(" int %s = insn->immed[%d];\n" % \
(hex_common.imm_name(immlett), i))
-def genptr_free(f, tag, regtype, regid, regno):
- if (regtype == "R"):
- if (regid in {"dd", "ss", "tt", "xx", "yy"}):
- f.write(" tcg_temp_free_i64(%s%sV);\n" % (regtype, regid))
- elif (regid in {"d", "e", "x", "y"}):
- f.write(" tcg_temp_free(%s%sV);\n" % (regtype, regid))
- elif (regid not in {"s", "t", "u", "v"}):
- print("Bad register parse: ",regtype,regid)
- elif (regtype == "P"):
- if (regid in {"d", "e", "x"}):
- f.write(" tcg_temp_free(%s%sV);\n" % (regtype, regid))
- elif (regid not in {"s", "t", "u", "v"}):
- print("Bad register parse: ",regtype,regid)
- elif (regtype == "C"):
- if (regid in {"dd", "ss"}):
- f.write(" tcg_temp_free_i64(%s%sV);\n" % (regtype, regid))
- elif (regid in {"d", "s"}):
- f.write(" tcg_temp_free(%s%sV);\n" % (regtype, regid))
- else:
- print("Bad register parse: ",regtype,regid)
- elif (regtype == "M"):
- if (regid != "u"):
- print("Bad register parse: ", regtype, regid)
- elif (regtype == "V"):
- if (regid in {"dd", "uu", "vv", "xx", \
- "d", "s", "u", "v", "w", "x", "y"}):
- if (not hex_common.skip_qemu_helper(tag)):
- f.write(" tcg_temp_free_ptr(%s%sV);\n" % \
- (regtype, regid))
- else:
- print("Bad register parse: ", regtype, regid)
- elif (regtype == "Q"):
- if (regid in {"d", "e", "s", "t", "u", "v", "x"}):
- if (not hex_common.skip_qemu_helper(tag)):
- f.write(" tcg_temp_free_ptr(%s%sV);\n" % \
- (regtype, regid))
- else:
- print("Bad register parse: ", regtype, regid)
- else:
- print("Bad register parse: ", regtype, regid)
-
-def genptr_free_new(f, tag, regtype, regid, regno):
- if (regtype == "N"):
- if (regid not in {"s", "t"}):
- print("Bad register parse: ", regtype, regid)
- elif (regtype == "P"):
- if (regid not in {"t", "u", "v"}):
- print("Bad register parse: ", regtype, regid)
- elif (regtype == "O"):
- if (regid != "s"):
- print("Bad register parse: ", regtype, regid)
- else:
- print("Bad register parse: ", regtype, regid)
-
-def genptr_free_opn(f,regtype,regid,i,tag):
- if (hex_common.is_pair(regid)):
- genptr_free(f, tag, regtype, regid, i)
- elif (hex_common.is_single(regid)):
- if hex_common.is_old_val(regtype, regid, tag):
- genptr_free(f, tag, regtype, regid, i)
- elif hex_common.is_new_val(regtype, regid, tag):
- genptr_free_new(f, tag, regtype, regid, i)
- else:
- print("Bad register parse: ",regtype,regid,toss,numregs)
- else:
- print("Bad register parse: ",regtype,regid,toss,numregs)
-
def genptr_src_read(f, tag, regtype, regid):
if (regtype == "R"):
if (regid in {"ss", "tt", "xx", "yy"}):
@@ -578,7 +508,6 @@ def genptr_dst_write_opn(f,regtype, regid, tag):
## <GEN>
## gen_log_reg_write(RdN, RdV);
## ctx_log_reg_write(ctx, RdN);
-## tcg_temp_free(RdV);
## }
##
## where <GEN> depends on hex_common.skip_qemu_helper(tag)
@@ -692,12 +621,6 @@ def gen_tcg_func(f, tag, regs, imms):
if (hex_common.is_written(regid)):
genptr_dst_write_opn(f,regtype, regid, tag)
- ## Free all the operands (regs and immediates)
- if hex_common.need_ea(tag): gen_free_ea_tcg(f)
- for regtype,regid,toss,numregs in regs:
- genptr_free_opn(f,regtype,regid,i,tag)
- i += 1
-
f.write("}\n\n")
def gen_def_tcg_func(f, tag, tagregs, tagimms):