================
@@ -1,36 +1,108 @@
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -finclude-default-header -triple \
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type
-fnative-int16-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF \
-// RUN: -DFNATTRS="hidden noundef nofpclass(nan inf)" -DTARGET=dx
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
-// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \
-// RUN: -DFNATTRS="hidden noundef nofpclass(nan inf)" -DTARGET=dx
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: -emit-llvm -O1 -o - | FileCheck %s
+// RUN: %clang_cc1 -finclude-default-header -triple \
// RUN: spirv-unknown-vulkan-library %s -fnative-half-type
-fnative-int16-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF \
-// RUN: -DFNATTRS="hidden spir_func noundef nofpclass(nan inf)" -DTARGET=spv
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: spirv-unknown-vulkan-library %s -emit-llvm -disable-llvm-passes \
-// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \
-// RUN: -DFNATTRS="hidden spir_func noundef nofpclass(nan inf)" -DTARGET=spv
+// RUN: -emit-llvm -O1 -o - | FileCheck %s --check-prefix=SPVCHECK
-// NATIVE_HALF: define [[FNATTRS]] <3 x half> @
-// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half>
@llvm.[[TARGET]].cross.v3f16(<3 x half>
-// NATIVE_HALF: ret <3 x half> %hlsl.cross
-// NO_HALF: define [[FNATTRS]] <3 x float> @
-// NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float>
@llvm.[[TARGET]].cross.v3f32(<3 x float>
-// NO_HALF: ret <3 x float> %hlsl.cross
+// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x half>
@_Z16test_cross_half3Dv3_DhS_(
+// CHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[P0:%.*]], <3 x half>
noundef nofpclass(nan inf) [[P1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT: [[ENTRY:.*:]]
+// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <3 x half> [[P0]], i64 1
+// CHECK-NEXT: [[VECEXT1_I:%.*]] = extractelement <3 x half> [[P1]], i64 2
+// CHECK-NEXT: [[MUL_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT1_I]], [[VECEXT_I]]
+// CHECK-NEXT: [[VECEXT2_I:%.*]] = extractelement <3 x half> [[P1]], i64 1
+// CHECK-NEXT: [[VECEXT3_I:%.*]] = extractelement <3 x half> [[P0]], i64 2
+// CHECK-NEXT: [[MUL4_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT2_I]], [[VECEXT3_I]]
+// CHECK-NEXT: [[SUB_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn half
[[MUL_I]], [[MUL4_I]]
+// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <3 x half> poison, half
[[SUB_I]], i64 0
+// CHECK-NEXT: [[VECEXT6_I:%.*]] = extractelement <3 x half> [[P1]], i64 0
+// CHECK-NEXT: [[MUL7_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT6_I]], [[VECEXT3_I]]
+// CHECK-NEXT: [[VECEXT9_I:%.*]] = extractelement <3 x half> [[P0]], i64 0
+// CHECK-NEXT: [[MUL10_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT1_I]], [[VECEXT9_I]]
+// CHECK-NEXT: [[SUB11_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn half
[[MUL7_I]], [[MUL10_I]]
+// CHECK-NEXT: [[VECINIT12_I:%.*]] = insertelement <3 x half>
[[VECINIT_I]], half [[SUB11_I]], i64 1
+// CHECK-NEXT: [[MUL15_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT2_I]], [[VECEXT9_I]]
+// CHECK-NEXT: [[MUL18_I:%.*]] = fmul reassoc nnan ninf nsz arcp afn half
[[VECEXT6_I]], [[VECEXT_I]]
+// CHECK-NEXT: [[SUB19_I:%.*]] = fsub reassoc nnan ninf nsz arcp afn half
[[MUL15_I]], [[MUL18_I]]
+// CHECK-NEXT: [[VECINIT20_I:%.*]] = insertelement <3 x half>
[[VECINIT12_I]], half [[SUB19_I]], i64 2
+// CHECK-NEXT: ret <3 x half> [[VECINIT20_I]]
+//
+// SPVCHECK-LABEL: define hidden spir_func noundef nofpclass(nan inf) <3 x
half> @_Z16test_cross_half3Dv3_DhS_(
----------------
farzonl wrote:
the whole advantage to doing this in the header should have been that we didn't
need a separate spv check
https://github.com/llvm/llvm-project/pull/211446
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits