You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
550 B
22 lines
550 B
; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a9 %s -o - | FileCheck %s
|
|
|
|
; CHECK-LABEL: max:
|
|
define i32 @max(i8 %ctx, i32* %ptr, i32 %val)
|
|
{
|
|
; CHECK: ldrex
|
|
; CHECK: cmp [[old:r[0-9]*]], [[val:r[0-9]*]]
|
|
; CHECK: movhi {{r[0-9]*}}, [[old]]
|
|
%old = atomicrmw umax i32* %ptr, i32 %val monotonic
|
|
ret i32 %old
|
|
}
|
|
|
|
; CHECK-LABEL: min:
|
|
define i32 @min(i8 %ctx, i32* %ptr, i32 %val)
|
|
{
|
|
; CHECK: ldrex
|
|
; CHECK: cmp [[old:r[0-9]*]], [[val:r[0-9]*]]
|
|
; CHECK: movls {{r[0-9]*}}, [[old]]
|
|
%old = atomicrmw umin i32* %ptr, i32 %val monotonic
|
|
ret i32 %old
|
|
}
|