2017-02-23 04:55:59 +08:00
|
|
|
// REQUIRES: amdgpu-registered-target
|
|
|
|
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx900 -S -emit-llvm -o - %s | FileCheck %s
|
2019-06-22 09:30:00 +08:00
|
|
|
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1010 -S -emit-llvm -o - %s | FileCheck %s
|
2017-02-23 04:55:59 +08:00
|
|
|
|
|
|
|
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
|
2021-05-13 03:53:47 +08:00
|
|
|
typedef unsigned int uint;
|
2021-02-25 07:14:30 +08:00
|
|
|
typedef unsigned long ulong;
|
2017-02-23 04:55:59 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL: @test_fmed3_f16
|
|
|
|
// CHECK: call half @llvm.amdgcn.fmed3.f16(half %a, half %b, half %c)
|
|
|
|
void test_fmed3_f16(global half* out, half a, half b, half c)
|
|
|
|
{
|
|
|
|
*out = __builtin_amdgcn_fmed3h(a, b, c);
|
|
|
|
}
|
2021-02-25 07:14:30 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL: @test_s_memtime
|
|
|
|
// CHECK: call i64 @llvm.amdgcn.s.memtime()
|
|
|
|
void test_s_memtime(global ulong* out)
|
|
|
|
{
|
|
|
|
*out = __builtin_amdgcn_s_memtime();
|
|
|
|
}
|
2021-05-13 03:53:47 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL: @test_groupstaticsize
|
|
|
|
// CHECK: call i32 @llvm.amdgcn.groupstaticsize()
|
|
|
|
void test_groupstaticsize(global uint* out)
|
|
|
|
{
|
|
|
|
*out = __builtin_amdgcn_groupstaticsize();
|
|
|
|
}
|