2011-08-31 02:31:29 +02:00
|
|
|
; RUN: llc < %s -mtriple=armv7-apple-ios | FileCheck %s
|
2013-08-22 14:19:24 +02:00
|
|
|
; RUN: llc < %s -mtriple=thumbv7-none-linux-gnueabihf -verify-machineinstrs | FileCheck %s --check-prefix=CHECK-THUMB
|
2011-08-31 02:31:29 +02:00
|
|
|
|
|
|
|
define i64 @test1(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test1:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: adds [[REG3:(r[0-9]?[02468])]], [[REG1]]
|
|
|
|
; CHECK: adc [[REG4:(r[0-9]?[13579])]], [[REG2]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test1:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: adds.w [[REG3:[a-z0-9]+]], [[REG1]]
|
|
|
|
; CHECK-THUMB: adc.w [[REG4:[a-z0-9]+]], [[REG2]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw add i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test2(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test2:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: subs [[REG3:(r[0-9]?[02468])]], [[REG1]]
|
|
|
|
; CHECK: sbc [[REG4:(r[0-9]?[13579])]], [[REG2]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test2:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: subs.w [[REG3:[a-z0-9]+]], [[REG1]]
|
|
|
|
; CHECK-THUMB: sbc.w [[REG4:[a-z0-9]+]], [[REG2]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw sub i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test3(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test3:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: and [[REG3:(r[0-9]?[02468])]], [[REG1]]
|
|
|
|
; CHECK: and [[REG4:(r[0-9]?[13579])]], [[REG2]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test3:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: and.w [[REG3:[a-z0-9]+]], [[REG1]]
|
|
|
|
; CHECK-THUMB: and.w [[REG4:[a-z0-9]+]], [[REG2]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw and i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test4(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test4:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: orr [[REG3:(r[0-9]?[02468])]], [[REG1]]
|
|
|
|
; CHECK: orr [[REG4:(r[0-9]?[13579])]], [[REG2]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test4:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: orr.w [[REG3:[a-z0-9]+]], [[REG1]]
|
|
|
|
; CHECK-THUMB: orr.w [[REG4:[a-z0-9]+]], [[REG2]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw or i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test5(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test5:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: eor [[REG3:(r[0-9]?[02468])]], [[REG1]]
|
|
|
|
; CHECK: eor [[REG4:(r[0-9]?[13579])]], [[REG2]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test5:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: eor.w [[REG3:[a-z0-9]+]], [[REG1]]
|
|
|
|
; CHECK-THUMB: eor.w [[REG4:[a-z0-9]+]], [[REG2]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw xor i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test6(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test6:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}}
|
2011-08-31 02:31:29 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test6:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, {{[a-z0-9]+}}, {{[a-z0-9]+}}
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 02:31:29 +02:00
|
|
|
%r = atomicrmw xchg i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
2011-08-31 02:41:05 +02:00
|
|
|
}
|
2011-08-31 19:52:22 +02:00
|
|
|
|
|
|
|
define i64 @test7(i64* %ptr, i64 %val1, i64 %val2) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test7:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: cmp [[REG1]]
|
|
|
|
; CHECK: cmpeq [[REG2]]
|
2011-08-31 19:52:22 +02:00
|
|
|
; CHECK: bne
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}}
|
2011-08-31 19:52:22 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test7:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: cmp [[REG1]]
|
|
|
|
; CHECK-THUMB: it eq
|
|
|
|
; CHECK-THUMB: cmpeq [[REG2]]
|
|
|
|
; CHECK-THUMB: bne
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, {{[a-z0-9]+}}, {{[a-z0-9]+}}
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 19:52:22 +02:00
|
|
|
%r = cmpxchg i64* %ptr, i64 %val1, i64 %val2 seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
2011-08-31 20:26:09 +02:00
|
|
|
|
2013-09-26 14:22:36 +02:00
|
|
|
; Compiles down to a single ldrexd
|
2011-08-31 20:26:09 +02:00
|
|
|
define i64 @test8(i64* %ptr) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test8:
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test8:
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 20:26:09 +02:00
|
|
|
%r = load atomic i64* %ptr seq_cst, align 8
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
; Compiles down to atomicrmw xchg; there really isn't any more efficient
|
|
|
|
; way to write it.
|
|
|
|
define void @test9(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test9:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-16 22:55:34 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}}
|
2011-08-31 20:26:09 +02:00
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test9:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, {{[a-z0-9]+}}, {{[a-z0-9]+}}
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2011-08-31 20:26:09 +02:00
|
|
|
store atomic i64 %val, i64* %ptr seq_cst, align 8
|
|
|
|
ret void
|
|
|
|
}
|
2012-11-29 15:41:25 +01:00
|
|
|
|
|
|
|
define i64 @test10(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test10:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: subs {{[a-z0-9]+}}, [[REG1]], [[REG3:(r[0-9]?[02468])]]
|
|
|
|
; CHECK: sbcs {{[a-z0-9]+}}, [[REG2]], [[REG4:(r[0-9]?[13579])]]
|
2013-01-25 11:39:49 +01:00
|
|
|
; CHECK: blt
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test10:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: subs.w {{[a-z0-9]+}}, [[REG1]], [[REG3:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: sbcs.w {{[a-z0-9]+}}, [[REG2]], [[REG4:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: blt
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2012-11-29 15:41:25 +01:00
|
|
|
%r = atomicrmw min i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test11(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test11:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: subs {{[a-z0-9]+}}, [[REG1]], [[REG3:(r[0-9]?[02468])]]
|
|
|
|
; CHECK: sbcs {{[a-z0-9]+}}, [[REG2]], [[REG4:(r[0-9]?[13579])]]
|
2013-01-25 11:39:49 +01:00
|
|
|
; CHECK: blo
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test11:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: subs.w {{[a-z0-9]+}}, [[REG1]], [[REG3:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: sbcs.w {{[a-z0-9]+}}, [[REG2]], [[REG4:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: blo
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2012-11-29 15:41:25 +01:00
|
|
|
%r = atomicrmw umin i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test12(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test12:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: subs {{[a-z0-9]+}}, [[REG1]], [[REG3:(r[0-9]?[02468])]]
|
|
|
|
; CHECK: sbcs {{[a-z0-9]+}}, [[REG2]], [[REG4:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: bge
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test12:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: subs.w {{[a-z0-9]+}}, [[REG1]], [[REG3:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: sbcs.w {{[a-z0-9]+}}, [[REG2]], [[REG4:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: bge
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2012-11-29 15:41:25 +01:00
|
|
|
%r = atomicrmw max i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test13(i64* %ptr, i64 %val) {
|
2013-07-13 22:38:47 +02:00
|
|
|
; CHECK-LABEL: test13:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2012-11-29 15:41:25 +01:00
|
|
|
; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], [[REG2:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: subs {{[a-z0-9]+}}, [[REG1]], [[REG3:(r[0-9]?[02468])]]
|
|
|
|
; CHECK: sbcs {{[a-z0-9]+}}, [[REG2]], [[REG4:(r[0-9]?[13579])]]
|
|
|
|
; CHECK: bhs
|
|
|
|
; CHECK: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK: cmp
|
|
|
|
; CHECK: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
|
2013-07-14 08:24:09 +02:00
|
|
|
; CHECK-THUMB-LABEL: test13:
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2013-01-29 10:06:13 +01:00
|
|
|
; CHECK-THUMB: ldrexd [[REG1:[a-z0-9]+]], [[REG2:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: subs.w {{[a-z0-9]+}}, [[REG1]], [[REG3:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: sbcs.w {{[a-z0-9]+}}, [[REG2]], [[REG4:[a-z0-9]+]]
|
|
|
|
; CHECK-THUMB: bhs
|
|
|
|
; CHECK-THUMB: strexd {{[a-z0-9]+}}, [[REG3]], [[REG4]]
|
|
|
|
; CHECK-THUMB: cmp
|
|
|
|
; CHECK-THUMB: bne
|
2013-07-03 11:20:36 +02:00
|
|
|
; CHECK-THUMB: dmb {{ish$}}
|
2012-11-29 15:41:25 +01:00
|
|
|
%r = atomicrmw umax i64* %ptr, i64 %val seq_cst
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|