|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx90a -emit-llvm -o - %s | FileCheck %s |
| 3 | + |
| 4 | +// REQUIRES: amdgpu-registered-target |
| 5 | + |
| 6 | +typedef half __attribute__((ext_vector_type(2))) float16x2_t; |
| 7 | + |
| 8 | +// CHECK-LABEL: define dso_local i32 @test_atomic_add_i32( |
| 9 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], i32 noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 10 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 11 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.amdgcn.raw.ptr.buffer.atomic.add.i32(i32 [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 12 | +// CHECK-NEXT: ret i32 [[TMP0]] |
| 13 | +// |
| 14 | +int test_atomic_add_i32(__amdgpu_buffer_rsrc_t rsrc, int x, int offset, int soffset) { |
| 15 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_add_i32(x, rsrc, offset, soffset, 0); |
| 16 | +} |
| 17 | + |
| 18 | +// CHECK-LABEL: define dso_local float @test_atomic_fadd_f32( |
| 19 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], float noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 20 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 21 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.amdgcn.raw.ptr.buffer.atomic.fadd.f32(float [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 22 | +// CHECK-NEXT: ret float [[TMP0]] |
| 23 | +// |
| 24 | +float test_atomic_fadd_f32(__amdgpu_buffer_rsrc_t rsrc, float x, int offset, int soffset) { |
| 25 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32(x, rsrc, offset, soffset, 0); |
| 26 | +} |
| 27 | + |
| 28 | +// CHECK-LABEL: define dso_local double @test_atomic_fadd_f64( |
| 29 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], double noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 30 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 31 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.amdgcn.raw.ptr.buffer.atomic.fadd.f64(double [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 32 | +// CHECK-NEXT: ret double [[TMP0]] |
| 33 | +// |
| 34 | +double test_atomic_fadd_f64(__amdgpu_buffer_rsrc_t rsrc, double x, int offset, int soffset) { |
| 35 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f64(x, rsrc, offset, soffset, 0); |
| 36 | +} |
| 37 | + |
| 38 | +// CHECK-LABEL: define dso_local <2 x half> @test_atomic_fadd_v2f16( |
| 39 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], <2 x half> noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 40 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 41 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <2 x half> @llvm.amdgcn.raw.ptr.buffer.atomic.fadd.v2f16(<2 x half> [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 42 | +// CHECK-NEXT: ret <2 x half> [[TMP0]] |
| 43 | +// |
| 44 | +float16x2_t test_atomic_fadd_v2f16(__amdgpu_buffer_rsrc_t rsrc, float16x2_t x, int offset, int soffset) { |
| 45 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(x, rsrc, offset, soffset, 0); |
| 46 | +} |
| 47 | + |
| 48 | +// CHECK-LABEL: define dso_local float @test_atomic_fmax_f32( |
| 49 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], float noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 50 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 51 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call float @llvm.amdgcn.raw.ptr.buffer.atomic.fmax.f32(float [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 52 | +// CHECK-NEXT: ret float [[TMP0]] |
| 53 | +// |
| 54 | +float test_atomic_fmax_f32(__amdgpu_buffer_rsrc_t rsrc, float x, int offset, int soffset) { |
| 55 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32(x, rsrc, offset, soffset, 0); |
| 56 | +} |
| 57 | + |
| 58 | +// CHECK-LABEL: define dso_local double @test_atomic_fmax_f64( |
| 59 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], double noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 60 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 61 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.amdgcn.raw.ptr.buffer.atomic.fmax.f64(double [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 62 | +// CHECK-NEXT: ret double [[TMP0]] |
| 63 | +// |
| 64 | +double test_atomic_fmax_f64(__amdgpu_buffer_rsrc_t rsrc, double x, int offset, int soffset) { |
| 65 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64(x, rsrc, offset, soffset, 0); |
| 66 | +} |
| 67 | + |
| 68 | +// CHECK-LABEL: define dso_local <2 x half> @test_atomic_fmax_v2f16( |
| 69 | +// CHECK-SAME: ptr addrspace(8) captures(none) [[RSRC:%.*]], <2 x half> noundef [[X:%.*]], i32 noundef [[OFFSET:%.*]], i32 noundef [[SOFFSET:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 70 | +// CHECK-NEXT: [[ENTRY:.*:]] |
| 71 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <2 x half> @llvm.amdgcn.raw.ptr.buffer.atomic.fmax.v2f16(<2 x half> [[X]], ptr addrspace(8) [[RSRC]], i32 [[OFFSET]], i32 [[SOFFSET]], i32 0) |
| 72 | +// CHECK-NEXT: ret <2 x half> [[TMP0]] |
| 73 | +// |
| 74 | +float16x2_t test_atomic_fmax_v2f16(__amdgpu_buffer_rsrc_t rsrc, float16x2_t x, int offset, int soffset) { |
| 75 | + return __builtin_amdgcn_raw_ptr_buffer_atomic_fmax_v2f16(x, rsrc, offset, soffset, 0); |
| 76 | +} |
0 commit comments