summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intel/compiler/gen8_md.py125
1 files changed, 125 insertions, 0 deletions
diff --git a/src/intel/compiler/gen8_md.py b/src/intel/compiler/gen8_md.py
index 5605ef1498ae..bbd9aa7a61d4 100644
--- a/src/intel/compiler/gen8_md.py
+++ b/src/intel/compiler/gen8_md.py
@@ -167,6 +167,131 @@ gen8_md = [
Instruction('ADD', r, r, b).predicate()))
),
+ # Comparisons
+ (('feq32', 'a@64', 'b@64'), InstructionList([(t0, DF),],
+ (Instruction('CMP', t0, a, b).cmod('Z'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('feq32', 'a@32', 'b@32'), Instruction('CMP', retype(r, F), a, b).cmod('Z')),
+ (('feq32', 'a@16', 'b@16'), InstructionList([(t0, HF),],
+ (Instruction('CMP', t0, a, b).cmod('Z'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+
+ (('fge32', 'a@64', 'b@64'), InstructionList([(t0, DF),],
+ (Instruction('CMP', t0, a, b).cmod('GE'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('fge32', 'a@32', 'b@32'), Instruction('CMP', retype(r, F), a, b).cmod('GE')),
+ (('fge32', 'a@16', 'b@16'), InstructionList([(t0, HF),],
+ (Instruction('CMP', t0, a, b).cmod('GE'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+
+ (('flt32', 'a@64', 'b@64'), InstructionList([(t0, DF),],
+ (Instruction('CMP', t0, a, b).cmod('L'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('flt32', 'a@32', 'b@32'), Instruction('CMP', retype(r, F), a, b).cmod('L')),
+ (('flt32', 'a@16', 'b@16'), InstructionList([(t0, HF),],
+ (Instruction('CMP', t0, a, b).cmod('L'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+
+ (('fne32', 'a@64', 'b@64'), InstructionList([(t0, DF),],
+ (Instruction('CMP', t0, a, b).cmod('NZ'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('fne32', 'a@32', 'b@32'), Instruction('CMP', retype(r, F), a, b).cmod('NZ')),
+ (('fne32', 'a@16', 'b@16'), InstructionList([(t0, HF),],
+ (Instruction('CMP', t0, a, b).cmod('NZ'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+
+ (('ieq32', 'a@64', 'b@64'), InstructionList([(t0, Q),],
+ (Instruction('CMP', t0, retype(a, Q), retype(b, Q)).cmod('Z'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('ieq32', 'a@32', 'b@32'), Instruction('CMP', retype(r, D), retype(a, D), retype(b, D)).cmod('Z')),
+ (('ieq32', 'a@16', 'b@16'), InstructionList([(t0, W),],
+ (Instruction('CMP', t0, retype(a, W), retype(b, W)).cmod('Z'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('ieq32', 'a@8', 'b@8' ), InstructionList([(t0, B),],
+ (Instruction('CMP', t0, retype(a, B), retype(b, B)).cmod('Z'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
+ (('ige32', 'a@64', 'b@64'), InstructionList([(t0, Q),],
+ (Instruction('CMP', t0, retype(a, Q), retype(b, Q)).cmod('GE'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('ige32', 'a@32', 'b@32'), Instruction('CMP', retype(r, D), retype(a, D), retype(b, D)).cmod('GE')),
+ (('ige32', 'a@16', 'b@16'), InstructionList([(t0, W),],
+ (Instruction('CMP', t0, retype(a, W), retype(b, W)).cmod('GE'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('ige32', 'a@8', 'b@8' ), InstructionList([(t0, B),],
+ (Instruction('CMP', t0, retype(a, B), retype(b, B)).cmod('GE'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
+ (('ilt32', 'a@64', 'b@64'), InstructionList([(t0, Q),],
+ (Instruction('CMP', t0, retype(a, Q), retype(b, Q)).cmod('L'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('ilt32', 'a@32', 'b@32'), Instruction('CMP', retype(r, D), retype(a, D), retype(b, D)).cmod('L')),
+ (('ilt32', 'a@16', 'b@16'), InstructionList([(t0, W),],
+ (Instruction('CMP', t0, retype(a, W), retype(b, W)).cmod('L'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('ilt32', 'a@8', 'b@8' ), InstructionList([(t0, B),],
+ (Instruction('CMP', t0, retype(a, B), retype(b, B)).cmod('L'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
+ (('uge32', 'a@64', 'b@64'), InstructionList([(t0, UQ),],
+ (Instruction('CMP', t0, retype(a, UQ), retype(b, UQ)).cmod('GE'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('uge32', 'a@32', 'b@32'), Instruction('CMP', retype(r, UD), retype(a, UD), retype(b, UD)).cmod('GE')),
+ (('uge32', 'a@16', 'b@16'), InstructionList([(t0, UW),],
+ (Instruction('CMP', t0, retype(a, UW), retype(b, UW)).cmod('GE'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('uge32', 'a@8', 'b@8' ), InstructionList([(t0, UB),],
+ (Instruction('CMP', t0, retype(a, UB), retype(b, UB)).cmod('GE'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
+ (('ult32', 'a@64', 'b@64'), InstructionList([(t0, UQ),],
+ (Instruction('CMP', t0, retype(a, UQ), retype(b, UQ)).cmod('L'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('ult32', 'a@32', 'b@32'), Instruction('CMP', retype(r, UD), retype(a, UD), retype(b, UD)).cmod('L')),
+ (('ult32', 'a@16', 'b@16'), InstructionList([(t0, UW),],
+ (Instruction('CMP', t0, retype(a, UW), retype(b, UW)).cmod('L'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('ult32', 'a@8', 'b@8' ), InstructionList([(t0, UB),],
+ (Instruction('CMP', t0, retype(a, UB), retype(b, UB)).cmod('L'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
+ (('ine32', 'a@64', 'b@64'), InstructionList([(t0, Q),],
+ (Instruction('CMP', t0, retype(a, Q), retype(b, Q)).cmod('NZ'),
+ Instruction('MOV', r, subscript(t0, UD, 0))))
+ ),
+ (('ine32', 'a@32', 'b@32'), Instruction('CMP', retype(r, D), retype(a, D), retype(b, D)).cmod('NZ')),
+ (('ine32', 'a@16', 'b@16'), InstructionList([(t0, W),],
+ (Instruction('CMP', t0, retype(a, W), retype(b, W)).cmod('NZ'),
+ Instruction('MOV', retype(r, D), retype(t0, W))))
+ ),
+ (('ine32', 'a@8', 'b@8' ), InstructionList([(t0, B),],
+ (Instruction('CMP', t0, retype(a, B), retype(b, B)).cmod('NZ'),
+ Instruction('MOV', retype(r, D), retype(t0, B))))
+ ),
+
# 3-source arithmetic
(('ffma', a, b, c), Instruction('MAD', r, c, b, a)),
(('flrp', a, b, c), Instruction('LRP', r, c, b, a)),