summary refs log tree commit diff stats
path: root/target/hexagon/gen_analyze_funcs.py
diff options
context:
space:
mode:
authorTaylor Simpson <ltaylorsimpson@gmail.com>2024-02-01 03:33:40 -0700
committerBrian Cain <bcain@quicinc.com>2024-05-05 16:22:07 -0700
commit763d2ce7c4f5bc6617b5c17a40f2faaf03fecb8e (patch)
tree41818440a22988d2abbf57ba2ed1b8ecfb1f21fd /target/hexagon/gen_analyze_funcs.py
parentbd983f68acad895d75678828d23e90ffeac58eea (diff)
downloadfocaccia-qemu-763d2ce7c4f5bc6617b5c17a40f2faaf03fecb8e.tar.gz
focaccia-qemu-763d2ce7c4f5bc6617b5c17a40f2faaf03fecb8e.zip
Hexagon (target/hexagon) Enable more short-circuit packets (HVX)
Look for read-after-write instead of overlap of reads and writes

HVX instructions with helpers have pass-by-reference semantics, so
we check for overlaps of reads and writes within the same instruction.

Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Message-Id: <20240201103340.119081-4-ltaylorsimpson@gmail.com>
Signed-off-by: Brian Cain <bcain@quicinc.com>
Diffstat (limited to 'target/hexagon/gen_analyze_funcs.py')
-rwxr-xr-xtarget/hexagon/gen_analyze_funcs.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/target/hexagon/gen_analyze_funcs.py b/target/hexagon/gen_analyze_funcs.py
index 890e6a3a95..81e1d9cfa3 100755
--- a/target/hexagon/gen_analyze_funcs.py
+++ b/target/hexagon/gen_analyze_funcs.py
@@ -43,6 +43,16 @@ def gen_analyze_func(f, tag, regs, imms):
     f.write("{\n")
 
     f.write("    Insn *insn G_GNUC_UNUSED = ctx->insn;\n")
+    if (hex_common.is_hvx_insn(tag)):
+        if hex_common.has_hvx_helper(tag):
+            f.write(
+                "    const bool G_GNUC_UNUSED insn_has_hvx_helper = true;\n"
+            )
+            f.write("    ctx_start_hvx_insn(ctx);\n")
+        else:
+            f.write(
+                "    const bool G_GNUC_UNUSED insn_has_hvx_helper = false;\n"
+            )
 
     ## Declare all the registers
     for regno, register in enumerate(regs):
@@ -64,15 +74,6 @@ def gen_analyze_func(f, tag, regs, imms):
         if reg.is_written():
             reg.analyze_write(f, tag, regno)
 
-    has_generated_helper = not hex_common.skip_qemu_helper(
-        tag
-    ) and not hex_common.is_idef_parser_enabled(tag)
-
-    ## Mark HVX instructions with generated helpers
-    if (has_generated_helper and
-        "A_CVI" in hex_common.attribdict[tag]):
-        f.write("    ctx->has_hvx_helper = true;\n")
-
     f.write("}\n\n")