Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGenOpenCL/builtins-amdgcn-fp8.cl @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
232:70dce7da266c | 236:c4bab56944e8 |
---|---|
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 | |
3 | |
4 typedef float v2f __attribute__((ext_vector_type(2))); | |
5 | |
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) | |
9 { | |
10 *out = __builtin_amdgcn_cvt_f32_bf8(a, 0); | |
11 } | |
12 | |
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) | |
16 { | |
17 *out = __builtin_amdgcn_cvt_f32_fp8(a, 1); | |
18 } | |
19 | |
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) | |
23 { | |
24 *out = __builtin_amdgcn_cvt_pk_f32_bf8(a, false); | |
25 } | |
26 | |
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) | |
30 { | |
31 *out = __builtin_amdgcn_cvt_pk_f32_fp8(a, true); | |
32 } | |
33 | |
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) | |
37 { | |
38 *out = __builtin_amdgcn_cvt_pk_bf8_f32(a, b, old, false); | |
39 } | |
40 | |
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) | |
44 { | |
45 *out = __builtin_amdgcn_cvt_pk_fp8_f32(a, b, old, true); | |
46 } | |
47 | |
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) | |
51 { | |
52 *out = __builtin_amdgcn_cvt_sr_bf8_f32(a, b, old, 2); | |
53 } | |
54 | |
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) | |
58 { | |
59 *out = __builtin_amdgcn_cvt_sr_fp8_f32(a, b, old, 3); | |
60 } |