Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SPARC/64atomics.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

67 lines
1.8 KiB
LLVM

; RUN: llc < %s -mtriple=sparc -mcpu=v9 -verify-machineinstrs | FileCheck %s --check-prefixes=SPARC,SPARC32
; RUN: llc < %s -mtriple=sparcv9 -verify-machineinstrs | FileCheck %s --check-prefixes=SPARC,SPARC64
; SPARC-LABEL: test_atomic_i64
; SPARC32: __atomic_load_8
; SPARC64: ldx [%o0]
; SPARC64: membar
; SPARC64: ldx [%o1]
; SPARC64: membar
; SPARC64: membar
; SPARC64: stx {{.+}}, [%o2]
define i64 @test_atomic_i64(ptr %ptr1, ptr %ptr2, ptr %ptr3) {
entry:
%0 = load atomic i64, ptr %ptr1 acquire, align 8
%1 = load atomic i64, ptr %ptr2 acquire, align 8
%2 = add i64 %0, %1
store atomic i64 %2, ptr %ptr3 release, align 8
ret i64 %2
}
; SPARC-LABEL: test_cmpxchg_i64
; SPARC32: __atomic_compare_exchange_8
; SPARC64: mov 123, [[R:%[gilo][0-7]]]
; SPARC64: casx [%o1], %o0, [[R]]
define i64 @test_cmpxchg_i64(i64 %a, ptr %ptr) {
entry:
%pair = cmpxchg ptr %ptr, i64 %a, i64 123 monotonic monotonic
%b = extractvalue { i64, i1 } %pair, 0
ret i64 %b
}
; SPARC-LABEL: test_swap_i64
; SPARC32: __atomic_exchange_8
; SPARC64: casx [%o1],
define i64 @test_swap_i64(i64 %a, ptr %ptr) {
entry:
%b = atomicrmw xchg ptr %ptr, i64 42 monotonic
ret i64 %b
}
; SPARC-LABEL: test_load_sub_64
; SPARC32: __atomic_fetch_sub_8
; SPARC64: membar
; SPARC64: sub
; SPARC64: casx [%o0]
; SPARC64: membar
define zeroext i64 @test_load_sub_64(ptr %p, i64 zeroext %v) {
entry:
%0 = atomicrmw sub ptr %p, i64 %v seq_cst
ret i64 %0
}
; SPARC-LABEL: test_load_max_64
; SPARC32: __atomic_compare_exchange_8
; SPARC64: membar
; SPARC64: cmp
; SPARC64: movg %xcc
; SPARC64: casx [%o0]
; SPARC64: membar
define zeroext i64 @test_load_max_64(ptr %p, i64 zeroext %v) {
entry:
%0 = atomicrmw max ptr %p, i64 %v seq_cst
ret i64 %0
}