[llvm] [DirectX] Add trig intrinsics and link them with DXIL backend (PR #95968)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 12:26:50 PDT 2024
================
@@ -0,0 +1,20 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for acos are generated for float and half.
+
+define noundef float @tan_float(float noundef %a) {
+entry:
+; CHECK:call float @dx.op.unary.f32(i32 15, float %{{.*}})
+ %elt.acos = call float @llvm.acos.f32(float %a)
+ ret float %elt.acos
+}
+
+define noundef half @tan_half(half noundef %a) {
+entry:
+; CHECK:call half @dx.op.unary.f16(i32 15, half %{{.*}})
+ %elt.acos = call half @llvm.acos.f16(half %a)
+ ret half %elt.acos
+}
+
+declare half @llvm.acos.f16(half)
+declare float @llvm.acos.f32(float)
----------------
farzonl wrote:
A change is needed in the dxil backend to scalarize vectors. We don’t have support for that yet, so we can’t test it. The only exceptions to this are dot product and the instruction expansion pass test cases.
https://github.com/llvm/llvm-project/pull/95968
More information about the llvm-commits
mailing list