1 ; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs | FileCheck %s -check-prefix=GFX90A
3 declare float @llvm.amdgcn.global.atomic.fadd.f32.p1.f32(ptr addrspace(1), float)
4 declare <2 x half> @llvm.amdgcn.global.atomic.fadd.v2f16.p1.v2f16(ptr addrspace(1), <2 x half>)
6 ; GFX90A-LABEL: {{^}}global_atomic_add_f32:
7 ; GFX90A: global_atomic_add_f32 v0, v[0:1], v2, off glc
8 define amdgpu_ps float @global_atomic_add_f32(ptr addrspace(1) %ptr, float %data) {
10 %ret = call float @llvm.amdgcn.global.atomic.fadd.f32.p1.f32(ptr addrspace(1) %ptr, float %data)
14 ; GFX90A-LABEL: {{^}}global_atomic_add_f32_off4:
15 ; GFX90A: global_atomic_add_f32 v0, v[0:1], v2, off offset:4 glc
16 define amdgpu_ps float @global_atomic_add_f32_off4(ptr addrspace(1) %ptr, float %data) {
18 %p = getelementptr float, ptr addrspace(1) %ptr, i64 1
19 %ret = call float @llvm.amdgcn.global.atomic.fadd.f32.p1.f32(ptr addrspace(1) %p, float %data)
23 ; GFX90A-LABEL: {{^}}global_atomic_add_f32_offneg4:
24 ; GFX90A: global_atomic_add_f32 v0, v[0:1], v2, off offset:-4 glc
25 define amdgpu_ps float @global_atomic_add_f32_offneg4(ptr addrspace(1) %ptr, float %data) {
27 %p = getelementptr float, ptr addrspace(1) %ptr, i64 -1
28 %ret = call float @llvm.amdgcn.global.atomic.fadd.f32.p1.f32(ptr addrspace(1) %p, float %data)
32 ; GFX90A-LABEL: {{^}}global_atomic_pk_add_v2f16:
33 ; GFX90A: global_atomic_pk_add_f16 v0, v[0:1], v2, off glc
34 define amdgpu_ps <2 x half> @global_atomic_pk_add_v2f16(ptr addrspace(1) %ptr, <2 x half> %data) {
36 %ret = call <2 x half> @llvm.amdgcn.global.atomic.fadd.v2f16.p1.v2f16(ptr addrspace(1) %ptr, <2 x half> %data)
40 ; GFX90A-LABEL: {{^}}global_atomic_pk_add_v2f16_off4:
41 ; GFX90A: global_atomic_pk_add_f16 v0, v[0:1], v2, off offset:4 glc
42 define amdgpu_ps <2 x half> @global_atomic_pk_add_v2f16_off4(ptr addrspace(1) %ptr, <2 x half> %data) {
44 %p = getelementptr <2 x half>, ptr addrspace(1) %ptr, i64 1
45 %ret = call <2 x half> @llvm.amdgcn.global.atomic.fadd.v2f16.p1.v2f16(ptr addrspace(1) %p, <2 x half> %data)
49 ; GFX90A-LABEL: {{^}}global_atomic_pk_add_v2f16_offneg4:
50 ; GFX90A: global_atomic_pk_add_f16 v0, v[0:1], v2, off offset:-4 glc
51 define amdgpu_ps <2 x half> @global_atomic_pk_add_v2f16_offneg4(ptr addrspace(1) %ptr, <2 x half> %data) {
53 %p = getelementptr <2 x half>, ptr addrspace(1) %ptr, i64 -1
54 %ret = call <2 x half> @llvm.amdgcn.global.atomic.fadd.v2f16.p1.v2f16(ptr addrspace(1) %p, <2 x half> %data)