mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
intel/perf: add support for new opcodes in code generation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
This commit is contained in:
parent
fe3e850dfb
commit
0df4b96062
1 changed files with 27 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue