2012-09-21 03:18:52 +00:00
|
|
|
; RUN: llc -march=x86-64 < %s | FileCheck %s
|
|
|
|
@sc8 = external global i8
|
|
|
|
|
|
|
|
define void @atomic_maxmin_i8() {
|
|
|
|
; CHECK: atomic_maxmin_i8
|
|
|
|
%1 = atomicrmw max i8* @sc8, i8 5 acquire
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: [[LABEL1:\.?LBB[0-9]+_[0-9]+]]:
|
2014-07-01 18:53:31 +00:00
|
|
|
; CHECK: movsbl
|
|
|
|
; CHECK: cmpl
|
2012-09-21 03:18:52 +00:00
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchgb
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: jne [[LABEL1]]
|
2012-09-21 03:18:52 +00:00
|
|
|
%2 = atomicrmw min i8* @sc8, i8 6 acquire
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: [[LABEL3:\.?LBB[0-9]+_[0-9]+]]:
|
2014-07-01 18:53:31 +00:00
|
|
|
; CHECK: movsbl
|
|
|
|
; CHECK: cmpl
|
2012-09-21 03:18:52 +00:00
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchgb
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: jne [[LABEL3]]
|
2012-09-21 03:18:52 +00:00
|
|
|
%3 = atomicrmw umax i8* @sc8, i8 7 acquire
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: [[LABEL5:\.?LBB[0-9]+_[0-9]+]]:
|
2014-07-01 18:53:31 +00:00
|
|
|
; CHECK: movzbl
|
|
|
|
; CHECK: cmpl
|
2012-09-21 03:18:52 +00:00
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchgb
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: jne [[LABEL5]]
|
2012-09-21 03:18:52 +00:00
|
|
|
%4 = atomicrmw umin i8* @sc8, i8 8 acquire
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: [[LABEL7:\.?LBB[0-9]+_[0-9]+]]:
|
2014-07-01 18:53:31 +00:00
|
|
|
; CHECK: movzbl
|
|
|
|
; CHECK: cmpl
|
2012-09-21 03:18:52 +00:00
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchgb
|
2012-09-21 05:19:19 +00:00
|
|
|
; CHECK: jne [[LABEL7]]
|
2012-09-21 03:18:52 +00:00
|
|
|
ret void
|
|
|
|
}
|