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 0, the module-level5; shader flag UseNativeLowPrecision is not set, and the MinimumPrecision feature6; flag is set due to the presence of half and i16 without native low precision.7 8target triple = "dxil-pc-shadermodel6.7-library"9 10;CHECK: ; Combined Shader Flags for Module11;CHECK-NEXT: ; Shader Flags Value: 0x0000002012;CHECK-NEXT: ;13;CHECK-NEXT: ; Note: shader requires additional functionality:14;CHECK-NEXT: ; Minimum-precision data types15;CHECK-NEXT: ; Note: extra DXIL module flags:16;CHECK-NEXT: ; Low-precision data types present17;CHECK-NOT: ; Enable native low-precision data types18;CHECK-NEXT: ;19;CHECK-NEXT: ; Shader Flags for Module Functions20 21;CHECK-LABEL: ; Function add_i16 : 0x0000002022define 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 : 0x0000000028define 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 : 0x0000002034define 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 0}41 42; DXC: - Name: SFI043; DXC-NEXT: Size: 844; DXC-NEXT: Flags:45; DXC: MinimumPrecision: true46; DXC: NativeLowPrecision: false47; DXC: ...48