llvm-project/clang/test/CodeGenOpenCL/builtins-fp-atomics-gfx1030.cl
Anshil Gandhi 39dac1f7f6 [clang] Add clang builtins support for gfx90a
Implement target builtins for gfx90a including fadd64, fadd32, add2h,
max and min on various global, flat and ds address spaces for which
intrinsics are implemented.

Differential Revision: https://reviews.llvm.org/D106909
2021-08-05 02:08:06 -06:00

15 lines
611 B
Common Lisp

// REQUIRES: amdgpu-registered-target
// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn-amd-amdhsa -target-cpu gfx1030 \
// RUN: -S -o - %s
// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn-amd-amdhsa -target-cpu gfx1030 \
// RUN: -S -o - %s | FileCheck -check-prefix=GFX1030 %s
// CHECK-LABEL: test_ds_addf_local
// CHECK: call float @llvm.amdgcn.ds.fadd.f32(float addrspace(3)* %{{.*}}, float %{{.*}},
// GFX1030-LABEL: test_ds_addf_local$local
// GFX1030: ds_add_rtn_f32
void test_ds_addf_local(__local float *addr, float x){
float *rtn;
*rtn = __builtin_amdgcn_ds_atomic_fadd_f32(addr, x);
}