2016-01-23 05:30:53 +08:00
|
|
|
// REQUIRES: amdgpu-registered-target
|
2016-06-08 09:56:42 +08:00
|
|
|
// RUN: %clang_cc1 -triple r600-unknown-unknown -target-cpu cypress -S -emit-llvm -o - %s | FileCheck %s
|
2014-06-25 04:45:01 +08:00
|
|
|
|
2014-07-16 01:23:46 +08:00
|
|
|
// CHECK-LABEL: @test_rsq_f32
|
2016-01-23 05:30:53 +08:00
|
|
|
// CHECK: call float @llvm.r600.rsq.f32
|
2014-07-16 01:23:46 +08:00
|
|
|
void test_rsq_f32(global float* out, float a)
|
|
|
|
{
|
|
|
|
*out = __builtin_amdgpu_rsqf(a);
|
|
|
|
}
|
|
|
|
|
2016-06-08 09:56:42 +08:00
|
|
|
#if cl_khr_fp64
|
|
|
|
// XCHECK-LABEL: @test_rsq_f64
|
|
|
|
// XCHECK: call double @llvm.r600.rsq.f64
|
2014-07-16 01:23:46 +08:00
|
|
|
void test_rsq_f64(global double* out, double a)
|
|
|
|
{
|
|
|
|
*out = __builtin_amdgpu_rsq(a);
|
|
|
|
}
|
2016-06-08 09:56:42 +08:00
|
|
|
#endif
|
2014-07-16 01:23:46 +08:00
|
|
|
|
2016-01-23 05:30:53 +08:00
|
|
|
// CHECK-LABEL: @test_legacy_ldexp_f32
|
2014-08-16 01:44:32 +08:00
|
|
|
// CHECK: call float @llvm.AMDGPU.ldexp.f32
|
2016-01-23 05:30:53 +08:00
|
|
|
void test_legacy_ldexp_f32(global float* out, float a, int b)
|
2014-08-16 01:44:32 +08:00
|
|
|
{
|
|
|
|
*out = __builtin_amdgpu_ldexpf(a, b);
|
|
|
|
}
|
|
|
|
|
2016-06-08 09:56:42 +08:00
|
|
|
#if cl_khr_fp64
|
|
|
|
// XCHECK-LABEL: @test_legacy_ldexp_f64
|
|
|
|
// XCHECK: call double @llvm.AMDGPU.ldexp.f64
|
2016-01-23 05:30:53 +08:00
|
|
|
void test_legacy_ldexp_f64(global double* out, double a, int b)
|
2014-08-16 01:44:32 +08:00
|
|
|
{
|
|
|
|
*out = __builtin_amdgpu_ldexp(a, b);
|
|
|
|
}
|
2016-06-08 09:56:42 +08:00
|
|
|
#endif
|