llvm-6502/test/CodeGen/X86/atomic-minmax-i6432.ll
Michael Liao e5e8f7656a Add missing i64 max/min/umax/umin on 32-bit target
- Turn on atomic6432.ll and add specific test case as well



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164616 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 18:08:13 +00:00

52 lines
1.1 KiB
LLVM

; RUN: llc -march=x86 -mattr=+cmov -mtriple=i386-pc-linux < %s | FileCheck %s
@sc64 = external global i64
define void @atomic_maxmin_i6432() {
; CHECK: atomic_maxmin_i6432
%1 = atomicrmw max i64* @sc64, i64 5 acquire
; CHECK: [[LABEL:.LBB[0-9]+_[0-9]+]]
; CHECK: cmpl
; CHECK: setl
; CHECK: cmpl
; CHECK: setl
; CHECK: cmovne
; CHECK: cmovne
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
; CHECK: jne [[LABEL]]
%2 = atomicrmw min i64* @sc64, i64 6 acquire
; CHECK: [[LABEL:.LBB[0-9]+_[0-9]+]]
; CHECK: cmpl
; CHECK: setg
; CHECK: cmpl
; CHECK: setg
; CHECK: cmovne
; CHECK: cmovne
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
; CHECK: jne [[LABEL]]
%3 = atomicrmw umax i64* @sc64, i64 7 acquire
; CHECK: [[LABEL:.LBB[0-9]+_[0-9]+]]
; CHECK: cmpl
; CHECK: setb
; CHECK: cmpl
; CHECK: setb
; CHECK: cmovne
; CHECK: cmovne
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
; CHECK: jne [[LABEL]]
%4 = atomicrmw umin i64* @sc64, i64 8 acquire
; CHECK: [[LABEL:.LBB[0-9]+_[0-9]+]]
; CHECK: cmpl
; CHECK: seta
; CHECK: cmpl
; CHECK: seta
; CHECK: cmovne
; CHECK: cmovne
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
; CHECK: jne [[LABEL]]
ret void
}