target/hexagon: Switch to tag_ignore(), generate via get_{user, sys}_tags()
Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Brian Cain committed
Jun 22, 2026 at 15:27 UTC
93f5179358c3f70170392f4cabb2046bd26dabb8
5 files changed
+28
-28
target/hexagon/gen_helper_funcs.py
+9
-15
@@ -104,29 +104,23 @@ def main():
104
tagimms = hex_common.get_tagimms()
105
106
with open(args.out, "w") as f:
107
- for tag in hex_common.tags:
108
- ## Skip the priv instructions
109
- if "A_PRIV" in hex_common.attribdict[tag]:
107
+ for tag in hex_common.get_user_tags():
108
+ if hex_common.tag_ignore(tag):
109
continue
111
- ## Skip the guest instructions
112
- if "A_GUEST" in hex_common.attribdict[tag]:
113
- continue
114
- ## Skip the floating point instructions
115
- if "A_FPOP" in hex_common.attribdict[tag]:
116
- continue
117
- ## Skip the diag instructions
118
- if tag == "Y6_diag":
119
- continue
120
- if tag == "Y6_diag0":
110
+ if hex_common.skip_qemu_helper(tag):
111
continue
122
- if tag == "Y6_diag1":
112
+ if hex_common.is_idef_parser_enabled(tag):
113
continue
114
+ gen_helper_function(f, tag, tagregs, tagimms)
115
+
116
+ f.write("#if !defined(CONFIG_USER_ONLY)\n")
117
+ for tag in hex_common.get_sys_tags():
118
if hex_common.skip_qemu_helper(tag):
119
continue
120
if hex_common.is_idef_parser_enabled(tag):
121
continue
128
-
122
gen_helper_function(f, tag, tagregs, tagimms)
123
+ f.write("#endif\n")
124
125
126
if __name__ == "__main__":
target/hexagon/gen_helper_protos.py
+12
-11
@@ -59,27 +59,28 @@ def main():
59
tagimms = hex_common.get_tagimms()
60
61
with open(args.out, "w") as f:
62
- for tag in hex_common.tags:
63
- ## Skip the priv instructions
64
- if "A_PRIV" in hex_common.attribdict[tag]:
62
+ for tag in hex_common.get_user_tags():
63
+ if hex_common.tag_ignore(tag):
64
continue
66
- ## Skip the guest instructions
67
- if "A_GUEST" in hex_common.attribdict[tag]:
68
- continue
69
- ## Skip the diag instructions
70
- if tag == "Y6_diag":
71
- continue
72
- if tag == "Y6_diag0":
65
+
66
+ if hex_common.skip_qemu_helper(tag):
67
continue
74
- if tag == "Y6_diag1":
68
+ if hex_common.is_idef_parser_enabled(tag):
69
continue
70
71
+ gen_helper_prototype(f, tag, tagregs, tagimms)
72
+
73
+ f.write("#if !defined(CONFIG_USER_ONLY)\n")
74
+ for tag in hex_common.get_sys_tags():
75
+ if hex_common.tag_ignore(tag):
76
+ continue
77
if hex_common.skip_qemu_helper(tag):
78
continue
79
if hex_common.is_idef_parser_enabled(tag):
80
continue
81
82
gen_helper_prototype(f, tag, tagregs, tagimms)
83
+ f.write("#endif\n")
84
85
86
if __name__ == "__main__":
target/hexagon/gen_idef_parser_funcs.py
+2
@@ -60,6 +60,8 @@ def main():
60
f.write('#include "macros.h.inc"\n\n')
61
62
for tag in hex_common.tags:
63
+ if hex_common.tag_ignore(tag):
64
+ continue
65
## Skip the priv instructions
66
if "A_PRIV" in hex_common.attribdict[tag]:
67
continue
target/hexagon/gen_op_attribs.py
+1
-1
@@ -38,7 +38,7 @@ def main():
38
## Generate all the attributes associated with each instruction
39
##
40
with open(args.out, "w") as f:
41
- for tag in hex_common.tags:
41
+ for tag in hex_common.get_all_tags():
42
f.write(
43
f"OP_ATTRIB({tag},ATTRIBS("
44
f'{",".join(sorted(hex_common.attribdict[tag]))}))\n'
target/hexagon/gen_opcodes_def.py
+4
-1
@@ -37,7 +37,10 @@ def main():
37
## Generate a list of all the opcodes
38
##
39
with open(args.out, "w") as f:
40
- for tag in hex_common.tags:
40
+ for tag in hex_common.get_user_tags():
41
+ f.write(f"OPCODE({tag}),\n")
42
+
43
+ for tag in hex_common.get_sys_tags():
44
f.write(f"OPCODE({tag}),\n")
45
46