Skip to content

Commit 1cfa415

Browse files
committed
remove all changes not needed for x86 support
1 parent 38903d3 commit 1cfa415

19 files changed

+1
-242
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±in
656656
T __builtin_elementwise_ceil(T x) return the smallest integral value greater than or equal to x floating point types
657657
T __builtin_elementwise_sin(T x) return the sine of x interpreted as an angle in radians floating point types
658658
T __builtin_elementwise_cos(T x) return the cosine of x interpreted as an angle in radians floating point types
659-
T __builtin_elementwise_tan(T x) return the tangent of x interpreted as an angle in radians floating point types
660659
T __builtin_elementwise_floor(T x) return the largest integral value less than or equal to x floating point types
661660
T __builtin_elementwise_log(T x) return the natural logarithm of x floating point types
662661
T __builtin_elementwise_log2(T x) return the base 2 logarithm of x floating point types

clang/include/clang/Basic/Builtins.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,12 +1326,6 @@ def ElementwiseSqrt : Builtin {
13261326
let Prototype = "void(...)";
13271327
}
13281328

1329-
def ElementwiseTan : Builtin {
1330-
let Spellings = ["__builtin_elementwise_tan"];
1331-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1332-
let Prototype = "void(...)";
1333-
}
1334-
13351329
def ElementwiseTrunc : Builtin {
13361330
let Spellings = ["__builtin_elementwise_trunc"];
13371331
let Attributes = [NoThrow, Const, CustomTypeChecking];

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,9 +3821,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
38213821
case Builtin::BI__builtin_elementwise_sin:
38223822
return RValue::get(
38233823
emitUnaryBuiltin(*this, E, llvm::Intrinsic::sin, "elt.sin"));
3824-
case Builtin::BI__builtin_elementwise_tan:
3825-
return RValue::get(
3826-
emitUnaryBuiltin(*this, E, llvm::Intrinsic::tan, "elt.tan"));
3824+
38273825
case Builtin::BI__builtin_elementwise_trunc:
38283826
return RValue::get(
38293827
emitUnaryBuiltin(*this, E, llvm::Intrinsic::trunc, "elt.trunc"));

clang/lib/Headers/hlsl/hlsl_intrinsics.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,29 +1441,6 @@ float3 sqrt(float3);
14411441
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_sqrt)
14421442
float4 sqrt(float4);
14431443

1444-
//===----------------------------------------------------------------------===//
1445-
// tan builtins
1446-
//===----------------------------------------------------------------------===//
1447-
#ifdef __HLSL_ENABLE_16_BIT
1448-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1449-
half tan(half);
1450-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1451-
half2 tan(half2);
1452-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1453-
half3 tan(half3);
1454-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1455-
half4 tan(half4);
1456-
#endif
1457-
1458-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1459-
float tan(float);
1460-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1461-
float2 tan(float2);
1462-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1463-
float3 tan(float3);
1464-
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_tan)
1465-
float4 tan(float4);
1466-
14671444
//===----------------------------------------------------------------------===//
14681445
// trunc builtins
14691446
//===----------------------------------------------------------------------===//

clang/lib/Sema/SemaChecking.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,6 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
30493049
case Builtin::BI__builtin_elementwise_nearbyint:
30503050
case Builtin::BI__builtin_elementwise_sin:
30513051
case Builtin::BI__builtin_elementwise_sqrt:
3052-
case Builtin::BI__builtin_elementwise_tan:
30533052
case Builtin::BI__builtin_elementwise_trunc:
30543053
case Builtin::BI__builtin_elementwise_canonicalize: {
30553054
if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
@@ -5680,7 +5679,6 @@ bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
56805679
case Builtin::BI__builtin_elementwise_roundeven:
56815680
case Builtin::BI__builtin_elementwise_sin:
56825681
case Builtin::BI__builtin_elementwise_sqrt:
5683-
case Builtin::BI__builtin_elementwise_tan:
56845682
case Builtin::BI__builtin_elementwise_trunc: {
56855683
if (CheckFloatOrHalfRepresentations(this, TheCall))
56865684
return true;

clang/test/CodeGen/builtins-elementwise-math.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -604,22 +604,6 @@ void test_builtin_elementwise_sqrt(float f1, float f2, double d1, double d2,
604604
vf2 = __builtin_elementwise_sqrt(vf1);
605605
}
606606

607-
void test_builtin_elementwise_tan(float f1, float f2, double d1, double d2,
608-
float4 vf1, float4 vf2) {
609-
// CHECK-LABEL: define void @test_builtin_elementwise_tan(
610-
// CHECK: [[F1:%.+]] = load float, ptr %f1.addr, align 4
611-
// CHECK-NEXT: call float @llvm.tan.f32(float [[F1]])
612-
f2 = __builtin_elementwise_tan(f1);
613-
614-
// CHECK: [[D1:%.+]] = load double, ptr %d1.addr, align 8
615-
// CHECK-NEXT: call double @llvm.tan.f64(double [[D1]])
616-
d2 = __builtin_elementwise_tan(d1);
617-
618-
// CHECK: [[VF1:%.+]] = load <4 x float>, ptr %vf1.addr, align 16
619-
// CHECK-NEXT: call <4 x float> @llvm.tan.v4f32(<4 x float> [[VF1]])
620-
vf2 = __builtin_elementwise_tan(vf1);
621-
}
622-
623607
void test_builtin_elementwise_trunc(float f1, float f2, double d1, double d2,
624608
float4 vf1, float4 vf2) {
625609
// CHECK-LABEL: define void @test_builtin_elementwise_trunc(

clang/test/CodeGen/strictfp-elementwise-bulitins.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,6 @@ float4 strict_elementwise_sqrt(float4 a) {
187187
return __builtin_elementwise_sqrt(a);
188188
}
189189

190-
// CHECK-LABEL: define dso_local noundef <4 x float> @_Z22strict_elementwise_tanDv4_f
191-
// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
192-
// CHECK-NEXT: entry:
193-
// CHECK-NEXT: [[ELT_TAN:%.*]] = tail call <4 x float> @llvm.tan.v4f32(<4 x float> [[A]]) #[[ATTR4]]
194-
// CHECK-NEXT: ret <4 x float> [[ELT_TAN]]
195-
//
196-
float4 strict_elementwise_tan(float4 a) {
197-
return __builtin_elementwise_tan(a);
198-
}
199-
200190
// CHECK-LABEL: define dso_local noundef <4 x float> @_Z24strict_elementwise_truncDv4_f
201191
// CHECK-SAME: (<4 x float> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {
202192
// CHECK-NEXT: entry:

clang/test/CodeGenHLSL/builtins/tan.hlsl

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

clang/test/Sema/aarch64-sve-vector-trig-ops.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,3 @@ svfloat32_t test_cos_vv_i8mf8(svfloat32_t v) {
1616
return __builtin_elementwise_cos(v);
1717
// expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
1818
}
19-
20-
svfloat32_t test_tan_vv_i8mf8(svfloat32_t v) {
21-
22-
return __builtin_elementwise_tan(v);
23-
// expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
24-
}

clang/test/Sema/builtins-elementwise-math.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -626,27 +626,6 @@ void test_builtin_elementwise_sqrt(int i, float f, double d, float4 v, int3 iv,
626626
// expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
627627
}
628628

629-
void test_builtin_elementwise_tan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
630-
631-
struct Foo s = __builtin_elementwise_tan(f);
632-
// expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
633-
634-
i = __builtin_elementwise_tan();
635-
// expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
636-
637-
i = __builtin_elementwise_tan(i);
638-
// expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
639-
640-
i = __builtin_elementwise_tan(f, f);
641-
// expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
642-
643-
u = __builtin_elementwise_tan(u);
644-
// expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
645-
646-
uv = __builtin_elementwise_tan(uv);
647-
// expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
648-
}
649-
650629
void test_builtin_elementwise_trunc(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
651630

652631
struct Foo s = __builtin_elementwise_trunc(f);

clang/test/Sema/riscv-rvv-vector-trig-ops.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@ vfloat32mf2_t test_cos_vv_i8mf8(vfloat32mf2_t v) {
1717
return __builtin_elementwise_cos(v);
1818
// expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
1919
}
20-
21-
vfloat32mf2_t test_tan_vv_i8mf8(vfloat32mf2_t v) {
22-
23-
return __builtin_elementwise_tan(v);
24-
// expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
25-
}

clang/test/SemaCXX/builtins-elementwise-math.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ void test_builtin_elementwise_sin() {
111111
static_assert(!is_const<decltype(__builtin_elementwise_sin(b))>::value);
112112
}
113113

114-
void test_builtin_elementwise_tan() {
115-
const float a = 42.0;
116-
float b = 42.3;
117-
static_assert(!is_const<decltype(__builtin_elementwise_tan(a))>::value);
118-
static_assert(!is_const<decltype(__builtin_elementwise_tan(b))>::value);
119-
}
120-
121114
void test_builtin_elementwise_sqrt() {
122115
const float a = 42.0;
123116
float b = 42.3;

clang/test/SemaHLSL/BuiltIns/half-float-only-errors.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_sin
1010
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_sqrt
1111
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_roundeven
12-
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_tan
1312
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -DTEST_FUNC=__builtin_elementwise_trunc
1413

1514
double2 test_double_builtin(double2 p0) {

llvm/lib/Target/DirectX/DXIL.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,6 @@ def Cos : DXILOpMapping<12, unary, int_cos,
266266
def Sin : DXILOpMapping<13, unary, int_sin,
267267
"Returns sine(theta) for theta in radians.",
268268
[llvm_halforfloat_ty, LLVMMatchType<0>]>;
269-
def Tan : DXILOpMapping<14, unary, int_tan,
270-
"Returns tangent(theta) for theta in radians.",
271-
[llvm_halforfloat_ty, LLVMMatchType<0>]>;
272269
def Exp2 : DXILOpMapping<21, unary, int_exp2,
273270
"Returns the base 2 exponential, or 2**x, of the specified value."
274271
"exp2(x) = 2**x.",

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg,
467467
return selectExtInst(ResVReg, ResType, I, CL::cos, GL::Cos);
468468
case TargetOpcode::G_FSIN:
469469
return selectExtInst(ResVReg, ResType, I, CL::sin, GL::Sin);
470-
case TargetOpcode::G_FTAN:
471-
return selectExtInst(ResVReg, ResType, I, CL::tan, GL::Tan);
472470

473471
case TargetOpcode::G_FSQRT:
474472
return selectExtInst(ResVReg, ResType, I, CL::sqrt, GL::Sqrt);

llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ SPIRVLegalizerInfo::SPIRVLegalizerInfo(const SPIRVSubtarget &ST) {
277277
G_FCEIL,
278278
G_FCOS,
279279
G_FSIN,
280-
G_FTAN,
281280
G_FSQRT,
282281
G_FFLOOR,
283282
G_FRINT,

llvm/test/CodeGen/DirectX/tan.ll

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

llvm/test/CodeGen/DirectX/tan_error.ll

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

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/tan.ll

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

0 commit comments

Comments
 (0)