Mesa (main): intel/perf: add support for new opcodes in code generation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 17 20:20:07 UTC 2022


Module: Mesa
Branch: main
Commit: 0df4b960623632137c7d337c48a37d6463906a71
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0df4b960623632137c7d337c48a37d6463906a71

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Wed Jun 23 17:40:00 2021 +0300

intel/perf: add support for new opcodes in code generation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>

---

 src/intel/perf/gen_perf.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/intel/perf/gen_perf.py b/src/intel/perf/gen_perf.py
index bdd1de27f1b..916fa2728ef 100644
--- a/src/intel/perf/gen_perf.py
+++ b/src/intel/perf/gen_perf.py
@@ -138,6 +138,22 @@ def emit_and(tmp_id, args):
     c("uint64_t tmp{0} = {1} & {2};".format(tmp_id, args[1], args[0]))
     return tmp_id + 1
 
+def emit_ulte(tmp_id, args):
+    c("uint64_t tmp{0} = {1} <= {2};".format(tmp_id, args[1], args[0]))
+    return tmp_id + 1
+
+def emit_ult(tmp_id, args):
+    c("uint64_t tmp{0} = {1} < {2};".format(tmp_id, args[1], args[0]))
+    return tmp_id + 1
+
+def emit_ugte(tmp_id, args):
+    c("uint64_t tmp{0} = {1} >= {2};".format(tmp_id, args[1], args[0]))
+    return tmp_id + 1
+
+def emit_ugt(tmp_id, args):
+    c("uint64_t tmp{0} = {1} > {2};".format(tmp_id, args[1], args[0]))
+    return tmp_id + 1
+
 ops = {}
 #             (n operands, emitter)
 ops["FADD"] = (2, emit_fadd)
@@ -154,6 +170,11 @@ ops["UMIN"] = (2, emit_umin)
 ops["<<"]   = (2, emit_lshft)
 ops[">>"]   = (2, emit_rshft)
 ops["AND"]  = (2, emit_and)
+ops["UGTE"] = (2, emit_ugte)
+ops["UGT"]  = (2, emit_ugt)
+ops["ULTE"] = (2, emit_ulte)
+ops["ULT"]  = (2, emit_ult)
+
 
 def brkt(subexp):
     if " " in subexp:
@@ -173,6 +194,12 @@ def splice_ult(args):
 def splice_ugte(args):
     return brkt(args[1]) + " >= " + brkt(args[0])
 
+def splice_ulte(args):
+    return brkt(args[1]) + " <= " + brkt(args[0])
+
+def splice_ugt(args):
+    return brkt(args[1]) + " > " + brkt(args[0])
+
 exp_ops = {}
 #                 (n operands, splicer)
 exp_ops["AND"]  = (2, splice_bitwise_and)



More information about the mesa-commit mailing list