Add __builtin_amdgpu_class

llvm-svn: 225314
This commit is contained in:
Matt Arsenault 2015-01-06 23:14:57 +00:00
parent a5f2816b1c
commit 6365ffea3e
3 changed files with 19 additions and 0 deletions

View File

@ -30,5 +30,7 @@ BUILTIN(__builtin_amdgpu_rsq_clamped, "dd", "nc")
BUILTIN(__builtin_amdgpu_rsq_clampedf, "ff", "nc")
BUILTIN(__builtin_amdgpu_ldexp, "ddi", "nc")
BUILTIN(__builtin_amdgpu_ldexpf, "ffi", "nc")
BUILTIN(__builtin_amdgpu_class, "bdi", "nc")
BUILTIN(__builtin_amdgpu_classf, "bfi", "nc")
#undef BUILTIN

View File

@ -6393,6 +6393,9 @@ Value *CodeGenFunction::EmitR600BuiltinExpr(unsigned BuiltinID,
case R600::BI__builtin_amdgpu_ldexp:
case R600::BI__builtin_amdgpu_ldexpf:
return emitFPIntBuiltin(*this, E, Intrinsic::AMDGPU_ldexp);
case R600::BI__builtin_amdgpu_class:
case R600::BI__builtin_amdgpu_classf:
return emitFPIntBuiltin(*this, E, Intrinsic::AMDGPU_class);
default:
return nullptr;
}

View File

@ -127,3 +127,17 @@ void test_ldexp_f64(global double* out, double a, int b)
{
*out = __builtin_amdgpu_ldexp(a, b);
}
// CHECK-LABEL: @test_class_f32
// CHECK: call i1 @llvm.AMDGPU.class.f32
void test_class_f32(global float* out, float a, int b)
{
*out = __builtin_amdgpu_classf(a, b);
}
// CHECK-LABEL: @test_class_f64
// CHECK: call i1 @llvm.AMDGPU.class.f64
void test_class_f64(global double* out, double a, int b)
{
*out = __builtin_amdgpu_class(a, b);
}