brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · ba844b1 Raw
48 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC3 4; Check that when the dx.nativelowprec module flag is set to 1, the module-level5; shader flag UseNativeLowPrecision is set, and the NativeLowPrecision feature6; flag is set7 8target triple = "dxil-pc-shadermodel6.7-library"9 10;CHECK: ; Combined Shader Flags for Module11;CHECK-NEXT: ; Shader Flags Value: 0x0080002012;CHECK-NEXT: ;13;CHECK-NEXT: ; Note: shader requires additional functionality:14;CHECK-NEXT: ;       Native low-precision data types15;CHECK-NEXT: ; Note: extra DXIL module flags:16;CHECK-NEXT: ;       Low-precision data types present17;CHECK-NEXT: ;       Enable native low-precision data types18;CHECK-NEXT: ;19;CHECK-NEXT: ; Shader Flags for Module Functions20 21;CHECK-LABEL: ; Function add_i16 : 0x0080002022define i16 @add_i16(i16 %a, i16 %b) "hlsl.export" {23  %sum = add i16 %a, %b24  ret i16 %sum25}26 27;CHECK-LABEL: ; Function add_i32 : 0x0080000028define i32 @add_i32(i32 %a, i32 %b) "hlsl.export" {29  %sum = add i32 %a, %b30  ret i32 %sum31}32 33;CHECK-LABEL: ; Function add_half : 0x0080002034define half @add_half(half %a, half %b) "hlsl.export" {35  %sum = fadd half %a, %b36  ret half %sum37}38 39!llvm.module.flags = !{!0}40!0 = !{i32 1, !"dx.nativelowprec", i32 1}41 42; DXC: - Name:            SFI043; DXC-NEXT:     Size:            844; DXC-NEXT:     Flags:45; DXC:      MinimumPrecision: false46; DXC:      NativeLowPrecision: true47; DXC: ...48