[clang] [HLSL] Add matrix support for float->float pure function intrinsics (PR #202455)

Kaitlin Peng via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 25 17:52:10 PDT 2026


================
@@ -0,0 +1,181 @@
+// 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 \
+// RUN:   --check-prefixes=CHECK,NATIVE_HALF
+// 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: %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 -o - | FileCheck %s \
+// RUN:   --check-prefixes=CHECK,NATIVE_HALF
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN:   spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
+// RUN:   -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
+
+// CHECK-LABEL: test_acos_float1x2
+// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
+// CHECK: ret <2 x float>
+float1x2 test_acos_float1x2(float1x2 p0) { return acos(p0); }
----------------
kmpeng wrote:

I don't think that same logic applies here. It made sense in the previous PR because it used the `[[ICF:dx]]/[[ICF:spv]]` mechanism in the CHECK lines, but none of these files do. Also, some of your tests here already put half before float. I don't see a reason why they can't all have half before float.

Either way, not going to block on this.

https://github.com/llvm/llvm-project/pull/202455


More information about the cfe-commits mailing list