[llvm] [DirectX] Add trig intrinsics and link them with DXIL backend (PR #95968)
Helena Kotas via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 12:23:48 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)
----------------
hekota wrote:
Should we have test cases with vectors too? We are not consistent - some intrinsics have vector tests in this folder and some do not.
https://github.com/llvm/llvm-project/pull/95968
More information about the llvm-commits
mailing list