Skip to content

Commit d27eff5

Browse files
committed
hlsl_generator: don't emit instructions with clashing capabilities
Signed-off-by: Ali Cheraghi <[email protected]>
1 parent 3f41681 commit d27eff5

File tree

2 files changed

+6
-216
lines changed

2 files changed

+6
-216
lines changed

tools/hlsl_generator/gen.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ def processInst(writer: io.TextIOWrapper, instruction, options: InstOptions):
288288
def writeInst(writer: io.TextIOWrapper, templates, caps, op_name, fn_name, conds, result_type, args):
289289
if len(caps) > 0:
290290
for cap in caps:
291+
if (("Float16" in cap and result_type != "float16_t") or
292+
("Float32" in cap and result_type != "float32_t") or
293+
("Float64" in cap and result_type != "float64_t") or
294+
("Int16" in cap and result_type != "int16_t" and result_type != "uint16_t") or
295+
("Int64" in cap and result_type != "int64_t" and result_type != "uint64_t")): continue
296+
291297
final_fn_name = fn_name
292298
if (len(caps) > 1): final_fn_name = fn_name + "_" + cap
293299
writeInstInner(writer, templates, cap, op_name, final_fn_name, conds, result_type, args)

0 commit comments

Comments
 (0)