-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hlsl dxil backend tests.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; RUN: opt -S -dxil-op-lower < %s | FileCheck %s | ||
|
||
; Make sure dxil operation function calls for tan are generated for float and half. | ||
|
||
define noundef float @tan_float(float noundef %a) #0 { | ||
entry: | ||
; CHECK:call float @dx.op.unary.f32(i32 14, float %{{.*}}) | ||
%elt.tan = call float @llvm.tan.f32(float %a) | ||
ret float %elt.tan | ||
} | ||
|
||
define noundef half @tan_half(half noundef %a) #0 { | ||
entry: | ||
; CHECK:call half @dx.op.unary.f16(i32 14, half %{{.*}}) | ||
%elt.tan = call half @llvm.tan.f16(half %a) | ||
ret half %elt.tan | ||
} | ||
|
||
declare half @llvm.tan.f16(half) | ||
declare float @llvm.tan.f32(float) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; RUN: not opt -S -dxil-op-lower %s 2>&1 | FileCheck %s | ||
|
||
; DXIL operation tan does not support double overload type | ||
; CHECK: LLVM ERROR: Invalid Overload | ||
|
||
define noundef double @tan_double(double noundef %a) #0 { | ||
entry: | ||
%1 = call double @llvm.tan.f64(double %a) | ||
ret double %1 | ||
} |