Skip to content

Commit bf5ff37

Browse files
committed
remove everything not needed by spirv
1 parent 7a44211 commit bf5ff37

38 files changed

+11
-585
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))
@@ -5665,7 +5664,6 @@ bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
56655664
case Builtin::BI__builtin_elementwise_roundeven:
56665665
case Builtin::BI__builtin_elementwise_sin:
56675666
case Builtin::BI__builtin_elementwise_sqrt:
5668-
case Builtin::BI__builtin_elementwise_tan:
56695667
case Builtin::BI__builtin_elementwise_trunc: {
56705668
if (CheckFloatOrHalfRepresentations(this, TheCall))
56715669
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);

0 commit comments

Comments
 (0)