| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 |
| 2 |
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx950 -emit-llvm -o - %s | FileCheck --check-prefix=GFX950 %s |
| 3 |
|
| 4 |
typedef int v2i __attribute__((ext_vector_type(2))); |
| 5 |
typedef int v3i __attribute__((ext_vector_type(3))); |
| 6 |
typedef short v4s __attribute__((ext_vector_type(4))); |
| 7 |
typedef half v4h __attribute__((ext_vector_type(4))); |
| 8 |
typedef __bf16 v4y __attribute__((ext_vector_type(4))); |
| 9 |
|
| 10 |
// GFX950-LABEL: define dso_local <2 x i32> @test_amdgcn_ds_read_b64_tr_b4_v2i32( |
| 11 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 12 |
// GFX950-NEXT: entry: |
| 13 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <2 x i32> @llvm.amdgcn.ds.read.tr4.b64.v2i32(ptr addrspace(3) [[INPTR]]) |
| 14 |
// GFX950-NEXT: ret <2 x i32> [[TMP0]] |
| 15 |
// |
| 16 |
v2i test_amdgcn_ds_read_b64_tr_b4_v2i32(local v2i* inptr) |
| 17 |
{ |
| 18 |
return __builtin_amdgcn_ds_read_tr4_b64_v2i32(inptr); |
| 19 |
} |
| 20 |
|
| 21 |
// GFX950-LABEL: define dso_local <3 x i32> @test_amdgcn_ds_read_b96_tr_b6_v3i32( |
| 22 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 23 |
// GFX950-NEXT: entry: |
| 24 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <3 x i32> @llvm.amdgcn.ds.read.tr6.b96.v3i32(ptr addrspace(3) [[INPTR]]) |
| 25 |
// GFX950-NEXT: ret <3 x i32> [[TMP0]] |
| 26 |
// |
| 27 |
v3i test_amdgcn_ds_read_b96_tr_b6_v3i32(local v3i* inptr) |
| 28 |
{ |
| 29 |
return __builtin_amdgcn_ds_read_tr6_b96_v3i32(inptr); |
| 30 |
} |
| 31 |
|
| 32 |
// GFX950-LABEL: define dso_local <2 x i32> @test_amdgcn_ds_read_b64_tr_b8_v2i32( |
| 33 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 34 |
// GFX950-NEXT: entry: |
| 35 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <2 x i32> @llvm.amdgcn.ds.read.tr8.b64.v2i32(ptr addrspace(3) [[INPTR]]) |
| 36 |
// GFX950-NEXT: ret <2 x i32> [[TMP0]] |
| 37 |
// |
| 38 |
v2i test_amdgcn_ds_read_b64_tr_b8_v2i32(local v2i* inptr) |
| 39 |
{ |
| 40 |
return __builtin_amdgcn_ds_read_tr8_b64_v2i32(inptr); |
| 41 |
} |
| 42 |
|
| 43 |
// GFX950-LABEL: define dso_local <4 x i16> @test_amdgcn_ds_read_b64_tr_b16_v2i16( |
| 44 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 45 |
// GFX950-NEXT: entry: |
| 46 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <4 x i16> @llvm.amdgcn.ds.read.tr16.b64.v4i16(ptr addrspace(3) [[INPTR]]) |
| 47 |
// GFX950-NEXT: ret <4 x i16> [[TMP0]] |
| 48 |
// |
| 49 |
v4s test_amdgcn_ds_read_b64_tr_b16_v2i16(local v4s* inptr) |
| 50 |
{ |
| 51 |
return __builtin_amdgcn_ds_read_tr16_b64_v4i16(inptr); |
| 52 |
} |
| 53 |
|
| 54 |
// GFX950-LABEL: define dso_local <4 x half> @test_amdgcn_ds_read_b64_tr_b16_v2f16( |
| 55 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 56 |
// GFX950-NEXT: entry: |
| 57 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <4 x half> @llvm.amdgcn.ds.read.tr16.b64.v4f16(ptr addrspace(3) [[INPTR]]) |
| 58 |
// GFX950-NEXT: ret <4 x half> [[TMP0]] |
| 59 |
// |
| 60 |
v4h test_amdgcn_ds_read_b64_tr_b16_v2f16(local v4h* inptr) |
| 61 |
{ |
| 62 |
return __builtin_amdgcn_ds_read_tr16_b64_v4f16(inptr); |
| 63 |
} |
| 64 |
|
| 65 |
// GFX950-LABEL: define dso_local <4 x bfloat> @test_amdgcn_ds_read_b64_tr_b16_v2bf16( |
| 66 |
// GFX950-SAME: ptr addrspace(3) noundef readonly captures(none) [[INPTR:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 67 |
// GFX950-NEXT: entry: |
| 68 |
// GFX950-NEXT: [[TMP0:%.*]] = tail call <4 x bfloat> @llvm.amdgcn.ds.read.tr16.b64.v4bf16(ptr addrspace(3) [[INPTR]]) |
| 69 |
// GFX950-NEXT: ret <4 x bfloat> [[TMP0]] |
| 70 |
// |
| 71 |
v4y test_amdgcn_ds_read_b64_tr_b16_v2bf16(local v4y* inptr) |
| 72 |
{ |
| 73 |
return __builtin_amdgcn_ds_read_tr16_b64_v4bf16(inptr); |
| 74 |
} |