aboutsummaryrefslogtreecommitdiff
path: root/target/hexagon/gen_helper_protos.py
diff options
context:
space:
mode:
authorAlessandro Di Federico <ale@rev.ng>2022-09-23 19:38:30 +0200
committerTaylor Simpson <tsimpson@quicinc.com>2022-12-16 12:30:11 -0800
commite71fdc4f1bd5632f2d152a08cbecd82b5aa9e954 (patch)
treea0575160e40695308447131d30a5a69b0c94f044 /target/hexagon/gen_helper_protos.py
parentc0a41ee631a146722a0d1365a788cbf503287570 (diff)
target/hexagon: call idef-parser functions
Extend gen_tcg_funcs.py in order to emit calls to the functions emitted by the idef-parser, if available. Signed-off-by: Alessandro Di Federico <ale@rev.ng> Signed-off-by: Anton Johansson <anjo@rev.ng> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> Message-Id: <20220923173831.227551-11-anjo@rev.ng>
Diffstat (limited to 'target/hexagon/gen_helper_protos.py')
-rwxr-xr-xtarget/hexagon/gen_helper_protos.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/target/hexagon/gen_helper_protos.py b/target/hexagon/gen_helper_protos.py
index ed4b9cf0d4..674bf370fa 100755
--- a/target/hexagon/gen_helper_protos.py
+++ b/target/hexagon/gen_helper_protos.py
@@ -146,11 +146,24 @@ def main():
hex_common.read_attribs_file(sys.argv[2])
hex_common.read_overrides_file(sys.argv[3])
hex_common.read_overrides_file(sys.argv[4])
+ ## Whether or not idef-parser is enabled is
+ ## determined by the number of arguments to
+ ## this script:
+ ##
+ ## 5 args. -> not enabled,
+ ## 6 args. -> idef-parser enabled.
+ ##
+ ## The 6:th arg. then holds a list of the successfully
+ ## parsed instructions.
+ is_idef_parser_enabled = len(sys.argv) > 6
+ if is_idef_parser_enabled:
+ hex_common.read_idef_parser_enabled_file(sys.argv[5])
hex_common.calculate_attribs()
tagregs = hex_common.get_tagregs()
tagimms = hex_common.get_tagimms()
- with open(sys.argv[5], 'w') as f:
+ output_file = sys.argv[-1]
+ with open(output_file, 'w') as f:
for tag in hex_common.tags:
## Skip the priv instructions
if ( "A_PRIV" in hex_common.attribdict[tag] ) :
@@ -168,6 +181,8 @@ def main():
if ( hex_common.skip_qemu_helper(tag) ):
continue
+ if ( hex_common.is_idef_parser_enabled(tag) ):
+ continue
gen_helper_prototype(f, tag, tagregs, tagimms)