1 ; RUN: llc -march=amdgcn -mcpu=gfx803 < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
2 ; RUN: llc -march=amdgcn -mcpu=gfx803 -filetype=obj < %s | llvm-objdump --triple=amdgcn--amdhsa --mcpu=gfx803 -d - | FileCheck -check-prefix=DISASSEMBLY-VI %s
4 ; Make sure we can encode and don't fail on functions which have
5 ; instructions not actually supported by the subtarget.
6 ; FIXME: This will still fail for gfx6/7 and gfx10 subtargets.
8 ; DISASSEMBLY-VI: .long 0xdd348000 // {{[0-9]+}}: DD348000
9 ; DISASSEMBLY-VI-NEXT: v_cndmask_b32_e32 v0, v0, v0, vcc // {{[0-9]+}}: 00000100
11 define amdgpu_kernel void @global_atomic_fadd_noret_f32_wrong_subtarget(float addrspace(1)* %ptr) #0 {
12 ; GCN-LABEL: global_atomic_fadd_noret_f32_wrong_subtarget:
14 ; GCN-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
15 ; GCN-NEXT: v_mov_b32_e32 v0, 0
16 ; GCN-NEXT: v_mov_b32_e32 v1, 4.0
17 ; GCN-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
18 ; GCN-NEXT: global_atomic_add_f32 v0, v1, s[0:1]
19 ; GCN-NEXT: s_waitcnt vmcnt(0)
20 ; GCN-NEXT: buffer_wbinvl1_vol
22 %result = atomicrmw fadd float addrspace(1)* %ptr, float 4.0 syncscope("agent") seq_cst
26 attributes #0 = { "denormal-fp-math-f32"="preserve-sign,preserve-sign" "target-features"="+atomic-fadd-insts" "amdgpu-unsafe-fp-atomics"="true" }