summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/atomicrmw_minmax.ll
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2012-09-26 09:48:32 +0000
committerJames Molloy <james.molloy@arm.com>2012-09-26 09:48:32 +0000
commit9e98ef1c59668c60711d5579558ea3105a3ae7d1 (patch)
treedd6f537b02409d39254702f5f573602777f18cca /llvm/test/CodeGen/ARM/atomicrmw_minmax.ll
parent39583b88a02ef7b9e1043c43509b18cdc60c3ebd (diff)
downloadbcm5719-llvm-9e98ef1c59668c60711d5579558ea3105a3ae7d1.tar.gz
bcm5719-llvm-9e98ef1c59668c60711d5579558ea3105a3ae7d1.zip
Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.
llvm-svn: 164685
Diffstat (limited to 'llvm/test/CodeGen/ARM/atomicrmw_minmax.ll')
-rw-r--r--llvm/test/CodeGen/ARM/atomicrmw_minmax.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/atomicrmw_minmax.ll b/llvm/test/CodeGen/ARM/atomicrmw_minmax.ll
new file mode 100644
index 00000000000..87ec23a9a37
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/atomicrmw_minmax.ll
@@ -0,0 +1,21 @@
+; RUN: llc -march=arm -mcpu=cortex-a9 %s -o - |& FileCheck %s
+
+; CHECK: 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: min:
+define i32 @min(i8 %ctx, i32* %ptr, i32 %val)
+{
+; CHECK: ldrex
+; CHECK: cmp [[old:r[0-9]*]], [[val:r[0-9]*]]
+; CHECK: movlo {{r[0-9]*}}, [[old]]
+ %old = atomicrmw umin i32* %ptr, i32 %val monotonic
+ ret i32 %old
+}
OpenPOWER on IntegriCloud