================
@@ -1,161 +1,312 @@
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type
-fnative-int16-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s -DTARGET=dx
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=dx \
+// RUN: --check-prefixes=CHECK,DXCHECK
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type
-fnative-int16-type \
-// RUN: -emit-llvm -disable-llvm-passes \
-// RUN: -o - | FileCheck %s -DTARGET=spv
+// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
+// RUN: -fnative-int16-type -emit-llvm -o - | FileCheck %s -DTARGET=spv \
+// RUN: --check-prefixes=CHECK,SPVCHECK
#ifdef __HLSL_ENABLE_16_BIT
// CHECK-LABEL: test_firstbithigh_ushort
// CHECK: call i32 @llvm.[[TARGET]].firstbituhigh.i16
+// DXCHECK: sub i32 15, {{.*}}
+// SPVCHECK-NOT: sub i32 15, {{.*}}
+// DXCHECK: icmp eq i32 {{.*}}, -1
+// SPVCHECK-NOT: icmp eq i32 {{.*}}, -1
+// DXCHECK: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
+// SPVCHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
----------------
Icohedron wrote:
A `SPVCHECK-NEXT` doesn't work because the result of the firstbithigh is stored
into an intermediate alloca and then the result of loading the alloca is
returned.
I could enable -O1 to remove those intermediate alloca stores and loads though.
https://github.com/llvm/llvm-project/pull/166419
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits