This change is part of this proposal: https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294 This is part 1 of 4 PRs. It sets the ground work for adding the intrinsics. Add DXIL Lower for `acos`, `asin`, `atan`, `cosh`, `sinh`, and `tanh` https://github.com/llvm/llvm-project/issues/70079 https://github.com/llvm/llvm-project/issues/70080 https://github.com/llvm/llvm-project/issues/70081 https://github.com/llvm/llvm-project/issues/70083 https://github.com/llvm/llvm-project/issues/70084 https://github.com/llvm/llvm-project/issues/95966
21 lines
584 B
LLVM
21 lines
584 B
LLVM
; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
|
|
|
|
; Make sure dxil operation function calls for atan are generated for float and half.
|
|
|
|
define noundef float @tan_float(float noundef %a) {
|
|
entry:
|
|
; CHECK:call float @dx.op.unary.f32(i32 17, float %{{.*}})
|
|
%elt.atan = call float @llvm.atan.f32(float %a)
|
|
ret float %elt.atan
|
|
}
|
|
|
|
define noundef half @tan_half(half noundef %a) {
|
|
entry:
|
|
; CHECK:call half @dx.op.unary.f16(i32 17, half %{{.*}})
|
|
%elt.atan = call half @llvm.atan.f16(half %a)
|
|
ret half %elt.atan
|
|
}
|
|
|
|
declare half @llvm.atan.f16(half)
|
|
declare float @llvm.atan.f32(float)
|