Skip to content

Commit 192f342

Browse files
committed
Rebased dxil_td/precise-overload-specification branch and
to create this branch Reverted classification of valid overload specification based on Shader Model version for sin. Will specify minimum DXIL Version for DXIL Ops.
1 parent 41e9bd0 commit 192f342

File tree

7 files changed

+5
-49
lines changed

7 files changed

+5
-49
lines changed

llvm/lib/Target/DirectX/DXIL.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ let OpClass = unary in {
111111

112112
def Cos : DXILOpMapping<12, int_cos, [DXILOpOverload<SM6_0, [llvm_half_ty, llvm_float_ty]>],
113113
"Returns cosine(theta) for theta in radians.">;
114-
def Sin : DXILOpMapping<13, int_sin, [DXILOpOverload<SM6_2, [llvm_half_ty, llvm_float_ty]>,
115-
DXILOpOverload<SM6_0, [llvm_float_ty]>],
114+
def Sin : DXILOpMapping<13, int_sin, [DXILOpOverload<SM6_0, [llvm_half_ty, llvm_float_ty]>],
116115
"Returns sine(theta) for theta in radians.">;
116+
def Tan : DXILOpMapping<14, int_tan, [DXILOpOverload<SM6_0, [llvm_half_ty, llvm_float_ty]>],
117+
"Returns tangent(theta) for theta in radians.">;
117118
def Exp2 : DXILOpMapping<21, int_exp2, [DXILOpOverload<SM6_0, [llvm_half_ty, llvm_float_ty]>],
118119
"Returns the base 2 exponential, or 2**x, of the"
119120
" specified value. exp2(x) = 2**x.">;

llvm/test/CodeGen/DirectX/sin_sm_62.ll renamed to llvm/test/CodeGen/DirectX/sin.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s -check-prefix=SM6_3
2-
; Half and float are valid for SM6.2 and later
32
; SM6_3: call half @dx.op.unary.f16(i32 13, half %{{.*}})
43
; SM6_3: call float @dx.op.unary.f32(i32 13, float %{{.*}})
54

llvm/test/CodeGen/DirectX/sin_sm_60.ll

Lines changed: 0 additions & 14 deletions
This file was deleted.

llvm/test/CodeGen/DirectX/sin_sm_60_error.ll

Lines changed: 0 additions & 14 deletions
This file was deleted.

llvm/test/CodeGen/DirectX/sin_sm_62_error.ll

Lines changed: 0 additions & 16 deletions
This file was deleted.

llvm/test/CodeGen/DirectX/tan.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
1+
; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library %s | FileCheck %s
22

33
; Make sure dxil operation function calls for tan are generated for float and half.
44

llvm/test/CodeGen/DirectX/tan_error.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: not opt -S -dxil-op-lower %s 2>&1 | FileCheck %s
1+
; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library %s 2>&1 | FileCheck %s
22

33
; DXIL operation tan does not support double overload type
44
; CHECK: LLVM ERROR: Invalid Overload

0 commit comments

Comments
 (0)