mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 16:56:35 +00:00
[HLSL] Add new int overloads for math builtins (#133162)
Add int overloads which cast the various ints to a float and call the float builtin. These overloads are conditional on hlsl version 202x or earlier. Add tests and puts tests in own files, including some of the tests added for double overloads. Closes #128229
This commit is contained in:
parent
3a5d77608b
commit
f612d70525
@ -50,35 +50,148 @@ namespace hlsl {
|
||||
return fn((float4)V1, (float4)V2, (float4)V3); \
|
||||
}
|
||||
|
||||
#define _DXC_COMPAT_UNARY_INTEGER_OVERLOADS(fn) \
|
||||
constexpr float fn(int V) { return fn((float)V); } \
|
||||
constexpr float2 fn(int2 V) { return fn((float2)V); } \
|
||||
constexpr float3 fn(int3 V) { return fn((float3)V); } \
|
||||
constexpr float4 fn(int4 V) { return fn((float4)V); } \
|
||||
constexpr float fn(uint V) { return fn((float)V); } \
|
||||
constexpr float2 fn(uint2 V) { return fn((float2)V); } \
|
||||
constexpr float3 fn(uint3 V) { return fn((float3)V); } \
|
||||
constexpr float4 fn(uint4 V) { return fn((float4)V); } \
|
||||
constexpr float fn(int64_t V) { return fn((float)V); } \
|
||||
constexpr float2 fn(int64_t2 V) { return fn((float2)V); } \
|
||||
constexpr float3 fn(int64_t3 V) { return fn((float3)V); } \
|
||||
constexpr float4 fn(int64_t4 V) { return fn((float4)V); } \
|
||||
constexpr float fn(uint64_t V) { return fn((float)V); } \
|
||||
constexpr float2 fn(uint64_t2 V) { return fn((float2)V); } \
|
||||
constexpr float3 fn(uint64_t3 V) { return fn((float3)V); } \
|
||||
constexpr float4 fn(uint64_t4 V) { return fn((float4)V); }
|
||||
|
||||
#define _DXC_COMPAT_BINARY_INTEGER_OVERLOADS(fn) \
|
||||
constexpr float fn(int V1, int V2) { return fn((float)V1, (float)V2); } \
|
||||
constexpr float2 fn(int2 V1, int2 V2) { return fn((float2)V1, (float2)V2); } \
|
||||
constexpr float3 fn(int3 V1, int3 V2) { return fn((float3)V1, (float3)V2); } \
|
||||
constexpr float4 fn(int4 V1, int4 V2) { return fn((float4)V1, (float4)V2); } \
|
||||
constexpr float fn(uint V1, uint V2) { return fn((float)V1, (float)V2); } \
|
||||
constexpr float2 fn(uint2 V1, uint2 V2) { \
|
||||
return fn((float2)V1, (float2)V2); \
|
||||
} \
|
||||
constexpr float3 fn(uint3 V1, uint3 V2) { \
|
||||
return fn((float3)V1, (float3)V2); \
|
||||
} \
|
||||
constexpr float4 fn(uint4 V1, uint4 V2) { \
|
||||
return fn((float4)V1, (float4)V2); \
|
||||
} \
|
||||
constexpr float fn(int64_t V1, int64_t V2) { \
|
||||
return fn((float)V1, (float)V2); \
|
||||
} \
|
||||
constexpr float2 fn(int64_t2 V1, int64_t2 V2) { \
|
||||
return fn((float2)V1, (float2)V2); \
|
||||
} \
|
||||
constexpr float3 fn(int64_t3 V1, int64_t3 V2) { \
|
||||
return fn((float3)V1, (float3)V2); \
|
||||
} \
|
||||
constexpr float4 fn(int64_t4 V1, int64_t4 V2) { \
|
||||
return fn((float4)V1, (float4)V2); \
|
||||
} \
|
||||
constexpr float fn(uint64_t V1, uint64_t V2) { \
|
||||
return fn((float)V1, (float)V2); \
|
||||
} \
|
||||
constexpr float2 fn(uint64_t2 V1, uint64_t2 V2) { \
|
||||
return fn((float2)V1, (float2)V2); \
|
||||
} \
|
||||
constexpr float3 fn(uint64_t3 V1, uint64_t3 V2) { \
|
||||
return fn((float3)V1, (float3)V2); \
|
||||
} \
|
||||
constexpr float4 fn(uint64_t4 V1, uint64_t4 V2) { \
|
||||
return fn((float4)V1, (float4)V2); \
|
||||
}
|
||||
|
||||
#define _DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(fn) \
|
||||
constexpr float fn(int V1, int V2, int V3) { \
|
||||
return fn((float)V1, (float)V2, (float)V3); \
|
||||
} \
|
||||
constexpr float2 fn(int2 V1, int2 V2, int2 V3) { \
|
||||
return fn((float2)V1, (float2)V2, (float2)V3); \
|
||||
} \
|
||||
constexpr float3 fn(int3 V1, int3 V2, int3 V3) { \
|
||||
return fn((float3)V1, (float3)V2, (float3)V3); \
|
||||
} \
|
||||
constexpr float4 fn(int4 V1, int4 V2, int4 V3) { \
|
||||
return fn((float4)V1, (float4)V2, (float4)V3); \
|
||||
} \
|
||||
constexpr float fn(uint V1, uint V2, uint V3) { \
|
||||
return fn((float)V1, (float)V2, (float)V3); \
|
||||
} \
|
||||
constexpr float2 fn(uint2 V1, uint2 V2, uint2 V3) { \
|
||||
return fn((float2)V1, (float2)V2, (float2)V3); \
|
||||
} \
|
||||
constexpr float3 fn(uint3 V1, uint3 V2, uint3 V3) { \
|
||||
return fn((float3)V1, (float3)V2, (float3)V3); \
|
||||
} \
|
||||
constexpr float4 fn(uint4 V1, uint4 V2, uint4 V3) { \
|
||||
return fn((float4)V1, (float4)V2, (float4)V3); \
|
||||
} \
|
||||
constexpr float fn(int64_t V1, int64_t V2, int64_t V3) { \
|
||||
return fn((float)V1, (float)V2, (float)V3); \
|
||||
} \
|
||||
constexpr float2 fn(int64_t2 V1, int64_t2 V2, int64_t2 V3) { \
|
||||
return fn((float2)V1, (float2)V2, (float2)V3); \
|
||||
} \
|
||||
constexpr float3 fn(int64_t3 V1, int64_t3 V2, int64_t3 V3) { \
|
||||
return fn((float3)V1, (float3)V2, (float3)V3); \
|
||||
} \
|
||||
constexpr float4 fn(int64_t4 V1, int64_t4 V2, int64_t4 V3) { \
|
||||
return fn((float4)V1, (float4)V2, (float4)V3); \
|
||||
} \
|
||||
constexpr float fn(uint64_t V1, uint64_t V2, uint64_t V3) { \
|
||||
return fn((float)V1, (float)V2, (float)V3); \
|
||||
} \
|
||||
constexpr float2 fn(uint64_t2 V1, uint64_t2 V2, uint64_t2 V3) { \
|
||||
return fn((float2)V1, (float2)V2, (float2)V3); \
|
||||
} \
|
||||
constexpr float3 fn(uint64_t3 V1, uint64_t3 V2, uint64_t3 V3) { \
|
||||
return fn((float3)V1, (float3)V2, (float3)V3); \
|
||||
} \
|
||||
constexpr float4 fn(uint64_t4 V1, uint64_t4 V2, uint64_t4 V3) { \
|
||||
return fn((float4)V1, (float4)V2, (float4)V3); \
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// acos builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(acos)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(acos)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// asin builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(asin)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(asin)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// atan builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(atan)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(atan)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// atan2 builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_BINARY_DOUBLE_OVERLOADS(atan2)
|
||||
_DXC_COMPAT_BINARY_INTEGER_OVERLOADS(atan2)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ceil builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(ceil)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(ceil)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// clamp builtins overloads
|
||||
@ -107,42 +220,49 @@ clamp(vector<T, N> p0, T p1, T p2) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(cos)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(cos)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// cosh builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(cosh)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(cosh)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// degrees builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(degrees)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(degrees)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// exp builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(exp)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(exp)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// exp2 builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(exp2)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(exp2)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// floor builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(floor)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(floor)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// frac builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(frac)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(frac)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// isinf builtins overloads
|
||||
@ -158,24 +278,28 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); }
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
|
||||
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// log builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(log)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(log)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// log10 builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(log10)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(log10)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// log2 builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(log2)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(log2)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// max builtins overloads
|
||||
@ -214,72 +338,84 @@ min(T p0, vector<T, N> p1) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(normalize)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(normalize)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// pow builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_BINARY_DOUBLE_OVERLOADS(pow)
|
||||
_DXC_COMPAT_BINARY_INTEGER_OVERLOADS(pow)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// rsqrt builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(rsqrt)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(rsqrt)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// round builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(round)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(round)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// sin builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(sin)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(sin)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// sinh builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(sinh)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(sinh)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// sqrt builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(sqrt)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(sqrt)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// step builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_BINARY_DOUBLE_OVERLOADS(step)
|
||||
_DXC_COMPAT_BINARY_INTEGER_OVERLOADS(step)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// tan builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(tan)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(tan)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// tanh builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(tanh)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(tanh)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// trunc builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(trunc)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(trunc)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// radians builtins overloads
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_DXC_COMPAT_UNARY_DOUBLE_OVERLOADS(radians)
|
||||
_DXC_COMPAT_UNARY_INTEGER_OVERLOADS(radians)
|
||||
|
||||
} // namespace hlsl
|
||||
#endif // _HLSL_COMPAT_OVERLOADS_H_
|
||||
|
123
clang/test/CodeGenHLSL/builtins/acos-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/acos-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_acos_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_double ( double p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_double2 ( double2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_double3 ( double3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_double4 ( double4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_int ( int p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_int2 ( int2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_int3 ( int3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_int4 ( int4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_uint ( uint p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_uint2 ( uint2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_uint3 ( uint3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_uint4 ( uint4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_int64_t ( int64_t p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_int64_t2 ( int64_t2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_int64_t3 ( int64_t3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_int64_t4 ( int64_t4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_uint64_t ( uint64_t p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_acos_float3 ( float3 p0 ) {
|
||||
float4 test_acos_float4 ( float4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
|
||||
float test_acos_double ( double p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
|
||||
float2 test_acos_double2 ( double2 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
|
||||
float3 test_acos_double3 ( double3 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_acos_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
|
||||
float4 test_acos_double4 ( double4 p0 ) {
|
||||
return acos ( p0 );
|
||||
}
|
||||
|
123
clang/test/CodeGenHLSL/builtins/asin-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/asin-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_asin_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_double ( double p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_double2 ( double2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_double3 ( double3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_double4 ( double4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_int ( int p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_int2 ( int2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_int3 ( int3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_int4 ( int4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_uint ( uint p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_uint2 ( uint2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_uint3 ( uint3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_uint4 ( uint4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_int64_t ( int64_t p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_int64_t2 ( int64_t2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_int64_t3 ( int64_t3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_int64_t4 ( int64_t4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_uint64_t ( uint64_t p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_asin_float3 ( float3 p0 ) {
|
||||
float4 test_asin_float4 ( float4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
|
||||
float test_asin_double ( double p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
|
||||
float2 test_asin_double2 ( double2 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
|
||||
float3 test_asin_double3 ( double3 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_asin_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
|
||||
float4 test_asin_double4 ( double4 p0 ) {
|
||||
return asin ( p0 );
|
||||
}
|
||||
|
123
clang/test/CodeGenHLSL/builtins/atan-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/atan-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_atan_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_double ( double p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_double2 ( double2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_double3 ( double3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_double4 ( double4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_int ( int p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_int2 ( int2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_int3 ( int3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_int4 ( int4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_uint ( uint p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_uint2 ( uint2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_uint3 ( uint3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_uint4 ( uint4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_int64_t ( int64_t p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_int64_t2 ( int64_t2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_int64_t3 ( int64_t3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_int64_t4 ( int64_t4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_uint64_t ( uint64_t p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_atan_float3 ( float3 p0 ) {
|
||||
float4 test_atan_float4 ( float4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan.f32
|
||||
float test_atan_double ( double p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan.v2f32
|
||||
float2 test_atan_double2 ( double2 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan.v3f32
|
||||
float3 test_atan_double3 ( double3 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan.v4f32
|
||||
float4 test_atan_double4 ( double4 p0 ) {
|
||||
return atan ( p0 );
|
||||
}
|
||||
|
123
clang/test/CodeGenHLSL/builtins/atan2-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/atan2-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_atan2_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_double (double p0, double p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_double2 (double2 p0, double2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_double3 (double3 p0, double3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_double4 (double4 p0, double4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_int (int p0, int p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_int2 (int2 p0, int2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_int3 (int3 p0, int3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_int4 (int4 p0, int4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_uint (uint p0, uint p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_uint2 (uint2 p0, uint2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_uint3 (uint3 p0, uint3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_uint4 (uint4 p0, uint4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_int64_t (int64_t p0, int64_t p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_int64_t2 (int64_t2 p0, int64_t2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_int64_t3 (int64_t3 p0, int64_t3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_int64_t4 (int64_t4 p0, int64_t4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_uint64_t (uint64_t p0, uint64_t p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_uint64_t2 (uint64_t2 p0, uint64_t2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_uint64_t3 (uint64_t3 p0, uint64_t3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_uint64_t4 (uint64_t4 p0, uint64_t4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_atan2_float3 (float3 p0, float3 p1) {
|
||||
float4 test_atan2_float4 (float4 p0, float4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.atan2.f32
|
||||
float test_atan2_double (double p0, double p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.atan2.v2f32
|
||||
float2 test_atan2_double2 (double2 p0, double2 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.atan2.v3f32
|
||||
float3 test_atan2_double3 (double3 p0, double3 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_atan2_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.atan2.v4f32
|
||||
float4 test_atan2_double4 (double4 p0, double4 p1) {
|
||||
return atan2(p0, p1);
|
||||
}
|
||||
|
70
clang/test/CodeGenHLSL/builtins/ceil-overloads.hlsl
Normal file
70
clang/test/CodeGenHLSL/builtins/ceil-overloads.hlsl
Normal file
@ -0,0 +1,70 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
using hlsl::ceil;
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_double(double p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_double2(double2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_double3(double3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_double4(double4 p0) { return ceil(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_int(int p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_int2(int2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_int3(int3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_int4(int4 p0) { return ceil(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_uint(uint p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_uint2(uint2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_uint3(uint3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_uint4(uint4 p0) { return ceil(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_int64_t(int64_t p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_int64_t2(int64_t2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_int64_t3(int64_t3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_int64_t4(int64_t4 p0) { return ceil(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_uint64_t(uint64_t p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_uint64_t2(uint64_t2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_uint64_t3(uint64_t3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_uint64_t4(uint64_t4 p0) { return ceil(p0); }
|
@ -40,16 +40,3 @@ float3 test_ceil_float3(float3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z16test_ceil_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_float4(float4 p0) { return ceil(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_ceil_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.ceil.f32(
|
||||
float test_ceil_double(double p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_ceil_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.ceil.v2f32(
|
||||
float2 test_ceil_double2(double2 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_ceil_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.ceil.v3f32(
|
||||
float3 test_ceil_double3(double3 p0) { return ceil(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_ceil_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.ceil.v4f32(
|
||||
float4 test_ceil_double4(double4 p0) { return ceil(p0); }
|
||||
|
68
clang/test/CodeGenHLSL/builtins/cos-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/cos-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_double(double p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_double2(double2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_double3(double3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_double4(double4 p0) { return cos(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_int(int p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_int2(int2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_int3(int3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_int4(int4 p0) { return cos(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_uint(uint p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_uint2(uint2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_uint3(uint3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_uint4(uint4 p0) { return cos(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_int64_t(int64_t p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_int64_t2(int64_t2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_int64_t3(int64_t3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_int64_t4(int64_t4 p0) { return cos(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_uint64_t(uint64_t p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_uint64_t2(uint64_t2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_uint64_t3(uint64_t3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_uint64_t4(uint64_t4 p0) { return cos(p0); }
|
@ -38,16 +38,3 @@ float3 test_cos_float3(float3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_cos_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_float4(float4 p0) { return cos(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_cos_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cos.f32(
|
||||
float test_cos_double(double p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_cos_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cos.v2f32
|
||||
float2 test_cos_double2(double2 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_cos_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cos.v3f32
|
||||
float3 test_cos_double3(double3 p0) { return cos(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_cos_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cos.v4f32
|
||||
float4 test_cos_double4(double4 p0) { return cos(p0); }
|
||||
|
123
clang/test/CodeGenHLSL/builtins/cosh-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/cosh-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_cosh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_double ( double p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_double2 ( double2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_double3 ( double3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_double4 ( double4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_int ( int p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_int2 ( int2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_int3 ( int3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_int4 ( int4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_uint ( uint p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_uint2 ( uint2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_uint3 ( uint3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_uint4 ( uint4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_int64_t ( int64_t p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_int64_t2 ( int64_t2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_int64_t3 ( int64_t3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_int64_t4 ( int64_t4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_uint64_t ( uint64_t p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_cosh_float3 ( float3 p0 ) {
|
||||
float4 test_cosh_float4 ( float4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.cosh.f32
|
||||
float test_cosh_double ( double p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.cosh.v2f32
|
||||
float2 test_cosh_double2 ( double2 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.cosh.v3f32
|
||||
float3 test_cosh_double3 ( double3 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_cosh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.cosh.v4f32
|
||||
float4 test_cosh_double4 ( double4 p0 ) {
|
||||
return cosh ( p0 );
|
||||
}
|
||||
|
93
clang/test/CodeGenHLSL/builtins/degrees-overloads.hlsl
Normal file
93
clang/test/CodeGenHLSL/builtins/degrees-overloads.hlsl
Normal file
@ -0,0 +1,93 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_double(double p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_double2(double2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_double3(double3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_double4(double4 p0) { return degrees(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_int(int p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_int2(int2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_int3(int3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_int4(int4 p0) { return degrees(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_uint(uint p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_uint2(uint2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_uint3(uint3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_uint4(uint4 p0) { return degrees(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_int64_t(int64_t p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_int64_t2(int64_t2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_int64_t3(int64_t3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_int64_t4(int64_t4 p0) { return degrees(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_uint64_t(uint64_t p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_uint64_t2(uint64_t2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_uint64_t3(uint64_t3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_uint64_t4(uint64_t4 p0) { return degrees(p0); }
|
@ -62,20 +62,3 @@ float3 test_degrees_float3(float3 p0) { return degrees(p0); }
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_float4(float4 p0) { return degrees(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].degrees.f32(
|
||||
// CHECK: ret float %hlsl.degrees
|
||||
float test_degrees_double(double p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].degrees.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.degrees
|
||||
float2 test_degrees_double2(double2 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].degrees.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.degrees
|
||||
float3 test_degrees_double3(double3 p0) { return degrees(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.degrees = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].degrees.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.degrees
|
||||
float4 test_degrees_double4(double4 p0) { return degrees(p0); }
|
||||
|
88
clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl
Normal file
88
clang/test/CodeGenHLSL/builtins/exp-overloads.hlsl
Normal file
@ -0,0 +1,88 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_double
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_double(double p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_double2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_double2(double2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_double3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_double3(double3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_double4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_double4(double4 p0) { return exp(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_int
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_int(int p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_int2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_int2(int2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_int3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_int3(int3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_int4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_int4(int4 p0) { return exp(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_uint
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_uint(uint p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_uint2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_uint2(uint2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_uint3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_uint3(uint3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_uint4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_uint4(uint4 p0) { return exp(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_int64_t
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_int64_t(int64_t p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_int64_t2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_int64_t2(int64_t2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_int64_t3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_int64_t3(int64_t3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_int64_t4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_int64_t4(int64_t4 p0) { return exp(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_uint64_t
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_uint64_t(uint64_t p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_uint64_t2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_uint64_t2(uint64_t2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_uint64_t3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_uint64_t3(uint64_t3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_uint64_t4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_uint64_t4(uint64_t4 p0) { return exp(p0); }
|
@ -50,20 +50,3 @@ float3 test_exp_float3(float3 p0) { return exp(p0); }
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_float4(float4 p0) { return exp(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp_double
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(
|
||||
// CHECK: ret float %elt.exp
|
||||
float test_exp_double(double p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp_double2
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp
|
||||
float2 test_exp_double2(double2 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp_double3
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp
|
||||
float3 test_exp_double3(double3 p0) { return exp(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp_double4
|
||||
// CHECK: %elt.exp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp
|
||||
float4 test_exp_double4(double4 p0) { return exp(p0); }
|
||||
|
88
clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl
Normal file
88
clang/test/CodeGenHLSL/builtins/exp2-overloads.hlsl
Normal file
@ -0,0 +1,88 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_double
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_double(double p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_double2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_double2(double2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_double3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_double3(double3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_double4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_double4(double4 p0) { return exp2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_int
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_int(int p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_int2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_int2(int2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_int3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_int3(int3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_int4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_int4(int4 p0) { return exp2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_uint
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_uint(uint p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_uint2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_uint2(uint2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_uint3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_uint3(uint3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_uint4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_uint4(uint4 p0) { return exp2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_int64_t
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_int64_t(int64_t p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_int64_t2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_int64_t2(int64_t2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_int64_t3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_int64_t3(int64_t3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_int64_t4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_int64_t4(int64_t4 p0) { return exp2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_uint64_t
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_uint64_t(uint64_t p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_uint64_t2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_uint64_t2(uint64_t2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_uint64_t3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_uint64_t3(uint64_t3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_uint64_t4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_uint64_t4(uint64_t4 p0) { return exp2(p0); }
|
@ -50,20 +50,3 @@ float3 test_exp2_float3(float3 p0) { return exp2(p0); }
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_float4(float4 p0) { return exp2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_exp2_double
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(
|
||||
// CHECK: ret float %elt.exp2
|
||||
float test_exp2_double(double p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_exp2_double2
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32
|
||||
// CHECK: ret <2 x float> %elt.exp2
|
||||
float2 test_exp2_double2(double2 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_exp2_double3
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32
|
||||
// CHECK: ret <3 x float> %elt.exp2
|
||||
float3 test_exp2_double3(double3 p0) { return exp2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_exp2_double4
|
||||
// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32
|
||||
// CHECK: ret <4 x float> %elt.exp2
|
||||
float4 test_exp2_double4(double4 p0) { return exp2(p0); }
|
||||
|
70
clang/test/CodeGenHLSL/builtins/floor-overloads.hlsl
Normal file
70
clang/test/CodeGenHLSL/builtins/floor-overloads.hlsl
Normal file
@ -0,0 +1,70 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
using hlsl::floor;
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_double(double p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_double2(double2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_double3(double3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_double4(double4 p0) { return floor(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_int(int p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_int2(int2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_int3(int3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_int4(int4 p0) { return floor(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_uint(uint p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_uint2(uint2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_uint3(uint3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_uint4(uint4 p0) { return floor(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_int64_t(int64_t p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_int64_t2(int64_t2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_int64_t3(int64_t3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_int64_t4(int64_t4 p0) { return floor(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_uint64_t(uint64_t p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_uint64_t2(uint64_t2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_uint64_t3(uint64_t3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_uint64_t4(uint64_t4 p0) { return floor(p0); }
|
@ -40,16 +40,3 @@ float3 test_floor_float3(float3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z17test_floor_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_float4(float4 p0) { return floor(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_floor_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.floor.f32(
|
||||
float test_floor_double(double p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_floor_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.floor.v2f32(
|
||||
float2 test_floor_double2(double2 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_floor_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.floor.v3f32(
|
||||
float3 test_floor_double3(double3 p0) { return floor(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_floor_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.floor.v4f32(
|
||||
float4 test_floor_double4(double4 p0) { return floor(p0); }
|
||||
|
93
clang/test/CodeGenHLSL/builtins/frac-overloads.hlsl
Normal file
93
clang/test/CodeGenHLSL/builtins/frac-overloads.hlsl
Normal file
@ -0,0 +1,93 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_double(double p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_double2(double2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_double3(double3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_double4(double4 p0) { return frac(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_int(int p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_int2(int2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_int3(int3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_int4(int4 p0) { return frac(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_uint(uint p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_uint2(uint2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_uint3(uint3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_uint4(uint4 p0) { return frac(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_int64_t(int64_t p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_int64_t2(int64_t2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_int64_t3(int64_t3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_int64_t4(int64_t4 p0) { return frac(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_uint64_t(uint64_t p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_uint64_t2(uint64_t2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_uint64_t3(uint64_t3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_uint64_t4(uint64_t4 p0) { return frac(p0); }
|
@ -62,20 +62,3 @@ float3 test_frac_float3(float3 p0) { return frac(p0); }
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_float4(float4 p0) { return frac(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].frac.f32(
|
||||
// CHECK: ret float %hlsl.frac
|
||||
float test_frac_double(double p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].frac.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.frac
|
||||
float2 test_frac_double2(double2 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].frac.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.frac
|
||||
float3 test_frac_double3(double3 p0) { return frac(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.frac = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].frac.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.frac
|
||||
float4 test_frac_double4(double4 p0) { return frac(p0); }
|
||||
|
108
clang/test/CodeGenHLSL/builtins/lerp-overloads.hlsl
Normal file
108
clang/test/CodeGenHLSL/builtins/lerp-overloads.hlsl
Normal file
@ -0,0 +1,108 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK-LABEL: test_lerp_double
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_double(double p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_double2(double2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_double3(double3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_double4(double4 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_int(int p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_int2(int2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_int3(int3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_int4(int4 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_uint(uint p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_uint2(uint2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_uint3(uint3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_uint4(uint4 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int64_t
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_int64_t(int64_t p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int64_t2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_int64_t2(int64_t2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int64_t3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_int64_t3(int64_t3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_int64_t4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_int64_t4(int64_t4 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint64_t
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_uint64_t(uint64_t p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint64_t2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_uint64_t2(uint64_t2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint64_t3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_uint64_t4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_uint64_t4(uint64_t4 p0) { return lerp(p0, p0, p0); }
|
@ -56,23 +56,3 @@ float3 test_lerp_float3(float3 p0) { return lerp(p0, p0, p0); }
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_float4(float4 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
|
||||
// CHECK: ret float %hlsl.lerp
|
||||
float test_lerp_double(double p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double2
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})
|
||||
// CHECK: ret <2 x float> %hlsl.lerp
|
||||
float2 test_lerp_double2(double2 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double3
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
|
||||
// CHECK: ret <3 x float> %hlsl.lerp
|
||||
float3 test_lerp_double3(double3 p0) { return lerp(p0, p0, p0); }
|
||||
|
||||
// CHECK-LABEL: test_lerp_double4
|
||||
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
|
||||
// CHECK: ret <4 x float> %hlsl.lerp
|
||||
float4 test_lerp_double4(double4 p0) { return lerp(p0, p0, p0); }
|
||||
|
68
clang/test/CodeGenHLSL/builtins/log-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/log-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_double(double p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_double2(double2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_double3(double3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_double4(double4 p0) { return log(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_int(int p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_int2(int2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_int3(int3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_int4(int4 p0) { return log(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_uint(uint p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_uint2(uint2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_uint3(uint3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_uint4(uint4 p0) { return log(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_int64_t(int64_t p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_int64_t2(int64_t2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_int64_t3(int64_t3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_int64_t4(int64_t4 p0) { return log(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_uint64_t(uint64_t p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_uint64_t2(uint64_t2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_uint64_t3(uint64_t3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_uint64_t4(uint64_t4 p0) { return log(p0); }
|
@ -38,16 +38,3 @@ float3 test_log_float3(float3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_log_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_float4(float4 p0) { return log(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(
|
||||
float test_log_double(double p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log.v2f32
|
||||
float2 test_log_double2(double2 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log.v3f32
|
||||
float3 test_log_double3(double3 p0) { return log(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log.v4f32
|
||||
float4 test_log_double4(double4 p0) { return log(p0); }
|
||||
|
68
clang/test/CodeGenHLSL/builtins/log10-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/log10-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_double(double p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_double2(double2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_double3(double3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_double4(double4 p0) { return log10(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_int(int p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_int2(int2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_int3(int3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_int4(int4 p0) { return log10(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_uint(uint p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_uint2(uint2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_uint3(uint3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_uint4(uint4 p0) { return log10(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_int64_t(int64_t p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_int64_t2(int64_t2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_int64_t3(int64_t3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_int64_t4(int64_t4 p0) { return log10(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_uint64_t(uint64_t p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_uint64_t2(uint64_t2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_uint64_t3(uint64_t3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_uint64_t4(uint64_t4 p0) { return log10(p0); }
|
@ -38,16 +38,3 @@ float3 test_log10_float3(float3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z17test_log10_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_float4(float4 p0) { return log10(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log10_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log10.f32(
|
||||
float test_log10_double(double p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log10_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log10.v2f32
|
||||
float2 test_log10_double2(double2 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log10_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log10.v3f32
|
||||
float3 test_log10_double3(double3 p0) { return log10(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log10_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log10.v4f32
|
||||
float4 test_log10_double4(double4 p0) { return log10(p0); }
|
||||
|
68
clang/test/CodeGenHLSL/builtins/log2-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/log2-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_double(double p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_double2(double2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_double3(double3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_double4(double4 p0) { return log2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_int(int p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_int2(int2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_int3(int3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_int4(int4 p0) { return log2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_uint(uint p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_uint2(uint2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_uint3(uint3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_uint4(uint4 p0) { return log2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_int64_t(int64_t p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_int64_t2(int64_t2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_int64_t3(int64_t3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_int64_t4(int64_t4 p0) { return log2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_uint64_t(uint64_t p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_uint64_t2(uint64_t2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_uint64_t3(uint64_t3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_uint64_t4(uint64_t4 p0) { return log2(p0); }
|
@ -38,16 +38,3 @@ float3 test_log2_float3(float3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z16test_log2_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_float4(float4 p0) { return log2(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_log2_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.log2.f32(
|
||||
float test_log2_double(double p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_log2_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.log2.v2f32
|
||||
float2 test_log2_double2(double2 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_log2_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.log2.v3f32
|
||||
float3 test_log2_double3(double3 p0) { return log2(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_log2_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.log2.v4f32
|
||||
float4 test_log2_double4(double4 p0) { return log2(p0); }
|
||||
|
156
clang/test/CodeGenHLSL/builtins/normalize-overloads.hlsl
Normal file
156
clang/test/CodeGenHLSL/builtins/normalize-overloads.hlsl
Normal file
@ -0,0 +1,156 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_double(double p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_double2(double2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_double3(double3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_double4(double4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_int(int p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_int2(int2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_int3(int3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_int4(int4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_uint(uint p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_uint2(uint2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_uint3(uint3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_uint4(uint4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_int64_t(int64_t p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_int64_t2(int64_t2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_int64_t3(int64_t3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_int64_t4(int64_t4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_uint64_t(uint64_t p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_uint64_t2(uint64_t2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_uint64_t3(uint64_t3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_uint64_t4(uint64_t4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
@ -83,33 +83,3 @@ float4 test_length_float4(float4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].normalize.f32(float
|
||||
// CHECK: ret float
|
||||
float test_normalize_double(double p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].normalize.v2f32(<2 x float>
|
||||
|
||||
// CHECK: ret <2 x float> %hlsl.normalize
|
||||
float2 test_normalize_double2(double2 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].normalize.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.normalize
|
||||
float3 test_normalize_double3(double3 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.normalize = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].normalize.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.normalize
|
||||
float4 test_length_double4(double4 p0)
|
||||
{
|
||||
return normalize(p0);
|
||||
}
|
||||
|
68
clang/test/CodeGenHLSL/builtins/pow-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/pow-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_double(double p0, double p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_double2(double2 p0, double2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_double3(double3 p0, double3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_double4(double4 p0, double4 p1) { return pow(p0, p1); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_int(int p0, int p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_int2(int2 p0, int2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_int3(int3 p0, int3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_int4(int4 p0, int4 p1) { return pow(p0, p1); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_uint(uint p0, uint p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_uint2(uint2 p0, uint2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_uint3(uint3 p0, uint3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_uint4(uint4 p0, uint4 p1) { return pow(p0, p1); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_int64_t(int64_t p0, int64_t p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_int64_t2(int64_t2 p0, int64_t2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_int64_t3(int64_t3 p0, int64_t3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_int64_t4(int64_t4 p0, int64_t4 p1) { return pow(p0, p1); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_uint64_t(uint64_t p0, uint64_t p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_uint64_t2(uint64_t2 p0, uint64_t2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_uint64_t3(uint64_t3 p0, uint64_t3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_uint64_t4(uint64_t4 p0, uint64_t4 p1) { return pow(p0, p1); }
|
@ -38,16 +38,3 @@ float3 test_pow_float3(float3 p0, float3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_pow_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_float4(float4 p0, float4 p1) { return pow(p0, p1); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_pow_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.pow.f32(
|
||||
float test_pow_double(double p0, double p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.pow.v2f32
|
||||
float2 test_pow_double2(double2 p0, double2 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.pow.v3f32
|
||||
float3 test_pow_double3(double3 p0, double3 p1) { return pow(p0, p1); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.pow.v4f32
|
||||
float4 test_pow_double4(double4 p0, double4 p1) { return pow(p0, p1); }
|
||||
|
93
clang/test/CodeGenHLSL/builtins/radians-overloads.hlsl
Normal file
93
clang/test/CodeGenHLSL/builtins/radians-overloads.hlsl
Normal file
@ -0,0 +1,93 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DTARGET=dx -DFNATTRS="noundef nofpclass(nan inf)"
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DTARGET=spv -DFNATTRS="spir_func noundef nofpclass(nan inf)"
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_double(double p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_double2(double2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_double3(double3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_double4(double4 p0) { return radians(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_int(int p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_int2(int2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_int3(int3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_int4(int4 p0) { return radians(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_uint(uint p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_uint2(uint2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_uint3(uint3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_uint4(uint4 p0) { return radians(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_int64_t(int64_t p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_int64_t2(int64_t2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_int64_t3(int64_t3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_int64_t4(int64_t4 p0) { return radians(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_uint64_t(uint64_t p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_uint64_t2(uint64_t2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_uint64_t3(uint64_t3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_uint64_t4(uint64_t4 p0) { return radians(p0); }
|
@ -63,20 +63,3 @@ float3 test_radians_float3(float3 p0) { return radians(p0); }
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_float4(float4 p0) { return radians(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].radians.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_radians_double(double p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].radians.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_radians_double2(double2 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].radians.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_radians_double3(double3 p0) { return radians(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].radians.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_radians_double4(double4 p0) { return radians(p0); }
|
||||
|
88
clang/test/CodeGenHLSL/builtins/round-overloads.hlsl
Normal file
88
clang/test/CodeGenHLSL/builtins/round-overloads.hlsl
Normal file
@ -0,0 +1,88 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_double
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_double(double p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_double2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_double2(double2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_double3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_double3(double3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_double4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_double4(double4 p0) { return round(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_int
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_int(int p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_int2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_int2(int2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_int3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_int3(int3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_int4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_int4(int4 p0) { return round(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_uint
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_uint(uint p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_uint2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_uint2(uint2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_uint3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_uint3(uint3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_uint4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_uint4(uint4 p0) { return round(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_int64_t
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_int64_t(int64_t p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_int64_t2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_int64_t2(int64_t2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_int64_t3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_int64_t3(int64_t3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_int64_t4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_int64_t4(int64_t4 p0) { return round(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_uint64_t
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_uint64_t(uint64_t p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_uint64_t2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_uint64_t2(uint64_t2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_uint64_t3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_uint64_t3(uint64_t3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_uint64_t4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_uint64_t4(uint64_t4 p0) { return round(p0); }
|
@ -50,20 +50,3 @@ float3 test_round_float3(float3 p0) { return round(p0); }
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_float4(float4 p0) { return round(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_round_double
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(
|
||||
// CHECK: ret float %elt.roundeven
|
||||
float test_round_double(double p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_double2
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f32
|
||||
// CHECK: ret <2 x float> %elt.roundeven
|
||||
float2 test_round_double2(double2 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_double3
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f32
|
||||
// CHECK: ret <3 x float> %elt.roundeven
|
||||
float3 test_round_double3(double3 p0) { return round(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_double4
|
||||
// CHECK: %elt.roundeven = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f32
|
||||
// CHECK: ret <4 x float> %elt.roundeven
|
||||
float4 test_round_double4(double4 p0) { return round(p0); }
|
||||
|
93
clang/test/CodeGenHLSL/builtins/rsqrt-overloads.hlsl
Normal file
93
clang/test/CodeGenHLSL/builtins/rsqrt-overloads.hlsl
Normal file
@ -0,0 +1,93 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_double(double p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_double2(double2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_double3(double3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_double4(double4 p0) { return rsqrt(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_int(int p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_int2(int2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_int3(int3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_int4(int4 p0) { return rsqrt(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_uint(uint p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_uint2(uint2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_uint3(uint3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_uint4(uint4 p0) { return rsqrt(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_int64_t(int64_t p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_int64_t2(int64_t2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_int64_t3(int64_t3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_int64_t4(int64_t4 p0) { return rsqrt(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_uint64_t(uint64_t p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_uint64_t2(uint64_t2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_uint64_t3(uint64_t3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_uint64_t4(uint64_t4 p0) { return rsqrt(p0); }
|
@ -62,20 +62,3 @@ float3 test_rsqrt_float3(float3 p0) { return rsqrt(p0); }
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_float4(float4 p0) { return rsqrt(p0); }
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].rsqrt.f32(
|
||||
// CHECK: ret float %hlsl.rsqrt
|
||||
float test_rsqrt_double(double p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].rsqrt.v2f32
|
||||
// CHECK: ret <2 x float> %hlsl.rsqrt
|
||||
float2 test_rsqrt_double2(double2 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].rsqrt.v3f32
|
||||
// CHECK: ret <3 x float> %hlsl.rsqrt
|
||||
float3 test_rsqrt_double3(double3 p0) { return rsqrt(p0); }
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.rsqrt = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].rsqrt.v4f32
|
||||
// CHECK: ret <4 x float> %hlsl.rsqrt
|
||||
float4 test_rsqrt_double4(double4 p0) { return rsqrt(p0); }
|
||||
|
68
clang/test/CodeGenHLSL/builtins/sin-overloads.hlsl
Normal file
68
clang/test/CodeGenHLSL/builtins/sin-overloads.hlsl
Normal file
@ -0,0 +1,68 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_double(double p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_double2(double2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_double3(double3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_double4(double4 p0) { return sin(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_int(int p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_int2(int2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_int3(int3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_int4(int4 p0) { return sin(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_uint(uint p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_uint2(uint2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_uint3(uint3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_uint4(uint4 p0) { return sin(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_int64_t(int64_t p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_int64_t2(int64_t2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_int64_t3(int64_t3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_int64_t4(int64_t4 p0) { return sin(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_uint64_t(uint64_t p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_uint64_t2(uint64_t2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_uint64_t3(uint64_t3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_uint64_t4(uint64_t4 p0) { return sin(p0); }
|
@ -38,16 +38,3 @@ float3 test_sin_float3(float3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_sin_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_float4(float4 p0) { return sin(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sin_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sin.f32(
|
||||
float test_sin_double(double p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sin_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sin.v2f32
|
||||
float2 test_sin_double2(double2 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sin_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sin.v3f32
|
||||
float3 test_sin_double3(double3 p0) { return sin(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sin_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sin.v4f32
|
||||
float4 test_sin_double4(double4 p0) { return sin(p0); }
|
||||
|
123
clang/test/CodeGenHLSL/builtins/sinh-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/sinh-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_sinh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_double ( double p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_double2 ( double2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_double3 ( double3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_double4 ( double4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_int ( int p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_int2 ( int2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_int3 ( int3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_int4 ( int4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_uint ( uint p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_uint2 ( uint2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_uint3 ( uint3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_uint4 ( uint4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_int64_t ( int64_t p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_int64_t2 ( int64_t2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_int64_t3 ( int64_t3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_int64_t4 ( int64_t4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_uint64_t ( uint64_t p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_sinh_float3 ( float3 p0 ) {
|
||||
float4 test_sinh_float4 ( float4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.sinh.f32
|
||||
float test_sinh_double ( double p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sinh.v2f32
|
||||
float2 test_sinh_double2 ( double2 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sinh.v3f32
|
||||
float3 test_sinh_double3 ( double3 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_sinh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sinh.v4f32
|
||||
float4 test_sinh_double4 ( double4 p0 ) {
|
||||
return sinh ( p0 );
|
||||
}
|
||||
|
88
clang/test/CodeGenHLSL/builtins/sqrt-overloads.hlsl
Normal file
88
clang/test/CodeGenHLSL/builtins/sqrt-overloads.hlsl
Normal file
@ -0,0 +1,88 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_double
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_double(double p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_double2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_double2(double2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_double3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_double3(double3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_double4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_double4(double4 p0) { return sqrt(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_int
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_int(int p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_int2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_int2(int2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_int3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_int3(int3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_int4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_int4(int4 p0) { return sqrt(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_uint
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_uint(uint p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_uint2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_uint2(uint2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_uint3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_uint3(uint3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_uint4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_uint4(uint4 p0) { return sqrt(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_int64_t
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_int64_t(int64_t p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_int64_t2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_int64_t2(int64_t2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_int64_t3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_int64_t3(int64_t3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_int64_t4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_int64_t4(int64_t4 p0) { return sqrt(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_uint64_t
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_uint64_t(uint64_t p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_uint64_t2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_uint64_t2(uint64_t2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_uint64_t3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_uint64_t3(uint64_t3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_uint64_t4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_uint64_t4(uint64_t4 p0) { return sqrt(p0); }
|
@ -50,20 +50,3 @@ float3 test_sqrt_float3(float3 p0) { return sqrt(p0); }
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_float4(float4 p0) { return sqrt(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_sqrt_double
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32(
|
||||
// CHECK: ret float %{{.*}}
|
||||
float test_sqrt_double(double p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_double2
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32
|
||||
// CHECK: ret <2 x float> %{{.*}}
|
||||
float2 test_sqrt_double2(double2 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_double3
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32
|
||||
// CHECK: ret <3 x float> %{{.*}}
|
||||
float3 test_sqrt_double3(double3 p0) { return sqrt(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_double4
|
||||
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32
|
||||
// CHECK: ret <4 x float> %{{.*}}
|
||||
float4 test_sqrt_double4(double4 p0) { return sqrt(p0); }
|
||||
|
153
clang/test/CodeGenHLSL/builtins/step-overloads.hlsl
Normal file
153
clang/test/CodeGenHLSL/builtins/step-overloads.hlsl
Normal file
@ -0,0 +1,153 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK \
|
||||
// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_double(double p0, double p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_double2(double2 p0, double2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_double3(double3 p0, double3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_double4(double4 p0, double4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_int(int p0, int p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_int2(int2 p0, int2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_int3(int3 p0, int3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_int4(int4 p0, int4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_uint(uint p0, uint p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_uint2(uint2 p0, uint2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_uint3(uint3 p0, uint3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_uint4(uint4 p0, uint4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_int64_t(int64_t p0, int64_t p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_int64_t2(int64_t2 p0, int64_t2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_int64_t3(int64_t3 p0, int64_t3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_int64_t4(int64_t4 p0, int64_t4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_uint64_t(uint64_t p0, uint64_t p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_uint64_t2(uint64_t2 p0, uint64_t2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_uint64_t3(uint64_t3 p0, uint64_t3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_uint64_t4(uint64_t4 p0, uint64_t4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
@ -82,32 +82,3 @@ float4 test_step_float4(float4 p0, float4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
||||
// CHECK: define [[FNATTRS]] float @
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].step.f32(float
|
||||
// CHECK: ret float
|
||||
float test_step_double(double p0, double p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <2 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].step.v2f32(
|
||||
// CHECK: ret <2 x float> %hlsl.step
|
||||
float2 test_step_double2(double2 p0, double2 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <3 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].step.v3f32(
|
||||
// CHECK: ret <3 x float> %hlsl.step
|
||||
float3 test_step_double3(double3 p0, double3 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
// CHECK: define [[FNATTRS]] <4 x float> @
|
||||
// CHECK: %hlsl.step = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].step.v4f32(
|
||||
// CHECK: ret <4 x float> %hlsl.step
|
||||
float4 test_step_double4(double4 p0, double4 p1)
|
||||
{
|
||||
return step(p0, p1);
|
||||
}
|
||||
|
123
clang/test/CodeGenHLSL/builtins/tan-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/tan-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_tan_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_double ( double p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_double2 ( double2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_double3 ( double3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_double4 ( double4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_int ( int p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_int2 ( int2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_int3 ( int3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_int4 ( int4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_uint ( uint p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_uint2 ( uint2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_uint3 ( uint3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_uint4 ( uint4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_int64_t ( int64_t p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_int64_t2 ( int64_t2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_int64_t3 ( int64_t3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_int64_t4 ( int64_t4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_uint64_t ( uint64_t p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_tan_float3 ( float3 p0 ) {
|
||||
float4 test_tan_float4 ( float4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tan.f32
|
||||
float test_tan_double ( double p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tan.v2f32
|
||||
float2 test_tan_double2 ( double2 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tan.v3f32
|
||||
float3 test_tan_double3 ( double3 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tan_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tan.v4f32
|
||||
float4 test_tan_double4 ( double4 p0 ) {
|
||||
return tan ( p0 );
|
||||
}
|
||||
|
123
clang/test/CodeGenHLSL/builtins/tanh-overloads.hlsl
Normal file
123
clang/test/CodeGenHLSL/builtins/tanh-overloads.hlsl
Normal file
@ -0,0 +1,123 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
|
||||
// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \
|
||||
// RUN: -o - | FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: test_tanh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_double ( double p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_double2 ( double2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_double3 ( double3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_double4 ( double4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_int ( int p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_int2 ( int2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_int3 ( int3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_int4 ( int4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_uint ( uint p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_uint2 ( uint2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_uint3 ( uint3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_uint4 ( uint4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_int64_t ( int64_t p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_int64_t2 ( int64_t2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_int64_t3 ( int64_t3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_int64_t4 ( int64_t4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_uint64_t ( uint64_t p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_uint64_t2 ( uint64_t2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_uint64_t3 ( uint64_t3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_uint64_t4 ( uint64_t4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
@ -57,27 +57,3 @@ float3 test_tanh_float3 ( float3 p0 ) {
|
||||
float4 test_tanh_float4 ( float4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.tanh.f32
|
||||
float test_tanh_double ( double p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.tanh.v2f32
|
||||
float2 test_tanh_double2 ( double2 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.tanh.v3f32
|
||||
float3 test_tanh_double3 ( double3 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
||||
// CHECK-LABEL: test_tanh_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.tanh.v4f32
|
||||
float4 test_tanh_double4 ( double4 p0 ) {
|
||||
return tanh ( p0 );
|
||||
}
|
||||
|
83
clang/test/CodeGenHLSL/builtins/trunc-overloads.hlsl
Normal file
83
clang/test/CodeGenHLSL/builtins/trunc-overloads.hlsl
Normal file
@ -0,0 +1,83 @@
|
||||
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
|
||||
// RUN: -emit-llvm -disable-llvm-passes -o - | \
|
||||
// RUN: FileCheck %s --check-prefixes=CHECK
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_double(double p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_double2(double2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_double3(double3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_double4(double4 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_int
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_int(int p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_int2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_int2(int2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_int3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_int3(int3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_int4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_int4(int4 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_uint
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_uint(uint p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_uint2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_uint2(uint2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_uint3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_uint3(uint3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_uint4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_uint4(uint4 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_int64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_int64_t(int64_t p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_int64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_int64_t2(int64_t2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_int64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_int64_t3(int64_t3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_int64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_int64_t4(int64_t4 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_uint64_t
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_uint64_t(uint64_t p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_uint64_t2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_uint64_t2(uint64_t2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_uint64_t3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_uint64_t3(uint64_t3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_uint64_t4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_uint64_t4(uint64_t4 p0) { return trunc(p0); }
|
@ -44,19 +44,3 @@ float3 test_trunc_float3(float3 p0) { return trunc(p0); }
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z17test_trunc_float4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_float4(float4 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) float {{.*}}test_trunc_double
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.trunc.f32(
|
||||
float test_trunc_double(double p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> {{.*}}test_trunc_double2
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.trunc.v2f32
|
||||
float2 test_trunc_double2(double2 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}test_trunc_double3
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.trunc.v3f32
|
||||
float3 test_trunc_double3(double3 p0) { return trunc(p0); }
|
||||
|
||||
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> {{.*}}test_trunc_double4
|
||||
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.trunc.v4f32
|
||||
float4 test_trunc_double4(double4 p0) { return trunc(p0); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user