brintos

brintos / llvm-project-archived public Read only

0
0
Text · 960 B · 3c9e35a Raw
21 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple \2// RUN:   dxil-pc-shadermodel6.3-library %s \3// RUN:   -emit-llvm -O1 -o - | FileCheck %s --check-prefixes=CHECK4 5// CHECK-LABEL: D3DCOLORtoUBYTE46int4 test_D3DCOLORtoUBYTE4(float4 p1) {7  // CHECK: %[[SCALED:.*]] = fmul [[FMFLAGS:.*]][[FLOAT_TYPE:<4 x float>]] %{{.*}}, splat (float 0x406FE01000000000)8  // CHECK: %[[CONVERTED:.*]] = fptosi [[FLOAT_TYPE]] %[[SCALED]] to [[INT_TYPE:<4 x i32>]]9  // CHECK: %[[SHUFFLED:.*]] = shufflevector [[INT_TYPE]] %[[CONVERTED]], [[INT_TYPE]] poison, <4 x i32> <i32 2, i32 1, i32 0, i32 3>10  // CHECK: ret [[INT_TYPE]] %[[SHUFFLED]]11  return D3DCOLORtoUBYTE4(p1);12}13 14// Note this test confirms issue 150673 is fixed 15// by confirming the negative does not become a poison16// CHECK-LABEL: test_constant_inputs17int4 test_constant_inputs() {18  // CHECK: ret <4 x i32> <i32 -12877, i32 2833, i32 0, i32 25500>19  return D3DCOLORtoUBYTE4(float4(0, 11.11, -50.5, 100));20}21