[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenOpenCL / builtins-amdgcn-fp8.cl
blob56d757012a5e780fa32358b6dec11d554227802a
1 // REQUIRES: amdgpu-registered-target
2 // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx940 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-GFX940
4 typedef float v2f __attribute__((ext_vector_type(2)));
6 // CHECK-GFX940-LABEL: @test_cvt_f32_bf8
7 // CHECK-GFX940: call float @llvm.amdgcn.cvt.f32.bf8(i32 %a, i32 0)
8 void test_cvt_f32_bf8(global int* out, int a)
10 *out = __builtin_amdgcn_cvt_f32_bf8(a, 0);
13 // CHECK-GFX940-LABEL: @test_cvt_f32_fp8
14 // CHECK-GFX940: call float @llvm.amdgcn.cvt.f32.fp8(i32 %a, i32 1)
15 void test_cvt_f32_fp8(global int* out, int a)
17 *out = __builtin_amdgcn_cvt_f32_fp8(a, 1);
20 // CHECK-GFX940-LABEL: @test_cvt_pk_f32_bf8
21 // CHECK-GFX940: call <2 x float> @llvm.amdgcn.cvt.pk.f32.bf8(i32 %a, i1 false)
22 void test_cvt_pk_f32_bf8(global v2f* out, int a)
24 *out = __builtin_amdgcn_cvt_pk_f32_bf8(a, false);
27 // CHECK-GFX940-LABEL: @test_cvt_pk_f32_fp8
28 // CHECK-GFX940: call <2 x float> @llvm.amdgcn.cvt.pk.f32.fp8(i32 %a, i1 true)
29 void test_cvt_pk_f32_fp8(global v2f* out, int a)
31 *out = __builtin_amdgcn_cvt_pk_f32_fp8(a, true);
34 // CHECK-GFX940-LABEL: @test_cvt_pk_bf8_f32
35 // CHECK-GFX940: call i32 @llvm.amdgcn.cvt.pk.bf8.f32(float %a, float %b, i32 %old, i1 false)
36 void test_cvt_pk_bf8_f32(global int* out, int old, float a, float b)
38 *out = __builtin_amdgcn_cvt_pk_bf8_f32(a, b, old, false);
41 // CHECK-GFX940-LABEL: @test_cvt_pk_fp8_f32
42 // CHECK-GFX940: call i32 @llvm.amdgcn.cvt.pk.fp8.f32(float %a, float %b, i32 %old, i1 true)
43 void test_cvt_pk_fp8_f32(global int* out, int old, float a, float b)
45 *out = __builtin_amdgcn_cvt_pk_fp8_f32(a, b, old, true);
48 // CHECK-GFX940-LABEL: @test_cvt_sr_bf8_f32
49 // CHECK-GFX940: call i32 @llvm.amdgcn.cvt.sr.bf8.f32(float %a, i32 %b, i32 %old, i32 2)
50 void test_cvt_sr_bf8_f32(global int* out, int old, float a, int b)
52 *out = __builtin_amdgcn_cvt_sr_bf8_f32(a, b, old, 2);
55 // CHECK-GFX940-LABEL: @test_cvt_sr_fp8_f32
56 // CHECK-GFX940: call i32 @llvm.amdgcn.cvt.sr.fp8.f32(float %a, i32 %b, i32 %old, i32 3)
57 void test_cvt_sr_fp8_f32(global int* out, int old, float a, int b)
59 *out = __builtin_amdgcn_cvt_sr_fp8_f32(a, b, old, 3);