diff options
author | Lionel Landwerlin <[email protected]> | 2018-02-22 17:17:40 +0000 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-03-22 20:14:22 +0000 |
commit | e7f6d1e5f8a4486b1c04b70979131fe4c1852809 (patch) | |
tree | 35e2fc094e382b6e1ae5e6a235f40b888d4ab715 | |
parent | 57a11550bc6195c404496e4278920ea63a343f08 (diff) |
i965: perf: add support for new equation operators
Some equations of the CNL metrics started to use operators we haven't
defined yet, just add those.
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_oa.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_oa.py b/src/mesa/drivers/dri/i965/brw_oa.py index b0b2be2af00..7bf7987b4ca 100644 --- a/src/mesa/drivers/dri/i965/brw_oa.py +++ b/src/mesa/drivers/dri/i965/brw_oa.py @@ -120,6 +120,18 @@ def emit_umin(tmp_id, args): c("uint64_t tmp{0} = MIN({1}, {2});".format(tmp_id, args[1], args[0])) return tmp_id + 1 +def emit_lshft(tmp_id, args): + c("uint64_t tmp{0} = {1} << {2};".format(tmp_id, args[1], args[0])) + return tmp_id + 1 + +def emit_rshft(tmp_id, args): + c("uint64_t tmp{0} = {1} >> {2};".format(tmp_id, args[1], args[0])) + return tmp_id + 1 + +def emit_and(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) @@ -133,6 +145,9 @@ ops["UDIV"] = (2, emit_udiv) ops["UMUL"] = (2, emit_umul) ops["USUB"] = (2, emit_usub) ops["UMIN"] = (2, emit_umin) +ops["<<"] = (2, emit_lshft) +ops[">>"] = (2, emit_rshft) +ops["AND"] = (2, emit_and) def brkt(subexp): if " " in subexp: |