1 ; Test 64-bit atomic ANDs.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
5 ; Check ANDs of a variable.
6 define i64 @f1(i64 %dummy, i64 *%src, i64 %b) {
8 ; CHECK: lg %r2, 0(%r3)
9 ; CHECK: [[LABEL:\.[^:]*]]:
12 ; CHECK: csg %r2, %r0, 0(%r3)
13 ; CHECK: jlh [[LABEL]]
15 %res = atomicrmw and i64 *%src, i64 %b seq_cst
19 ; Check ANDs of 1, which must be done using a register.
20 define i64 @f2(i64 %dummy, i64 *%src) {
24 %res = atomicrmw and i64 *%src, i64 1 seq_cst
28 ; Check the low end of the NIHF range.
29 define i64 @f3(i64 %dummy, i64 *%src) {
31 ; CHECK: lg %r2, 0(%r3)
32 ; CHECK: [[LABEL:\.[^:]*]]:
35 ; CHECK: csg %r2, %r0, 0(%r3)
36 ; CHECK: jlh [[LABEL]]
38 %res = atomicrmw and i64 *%src, i64 4294967295 seq_cst
42 ; Check the next value up, which must use a register.
43 define i64 @f4(i64 %dummy, i64 *%src) {
47 %res = atomicrmw and i64 *%src, i64 4294967296 seq_cst
51 ; Check the low end of the NIHH range.
52 define i64 @f5(i64 %dummy, i64 *%src) {
56 %res = atomicrmw and i64 *%src, i64 281474976710655 seq_cst
60 ; Check the next value up, which must use a register.
61 define i64 @f6(i64 %dummy, i64 *%src) {
65 %res = atomicrmw and i64 *%src, i64 281474976710656 seq_cst
69 ; Check the highest useful NILL value.
70 define i64 @f7(i64 %dummy, i64 *%src) {
72 ; CHECK: nill %r0, 65534
74 %res = atomicrmw and i64 *%src, i64 -2 seq_cst
78 ; Check the low end of the NILL range.
79 define i64 @f8(i64 %dummy, i64 *%src) {
83 %res = atomicrmw and i64 *%src, i64 -65536 seq_cst
87 ; Check the highest useful NILH value, which is one less than the above.
88 define i64 @f9(i64 %dummy, i64 *%src) {
90 ; CHECK: nilh %r0, 65534
92 %res = atomicrmw and i64 *%src, i64 -65537 seq_cst
96 ; Check the highest useful NILF value, which is one less than the above.
97 define i64 @f10(i64 %dummy, i64 *%src) {
99 ; CHECK: nilf %r0, 4294901758
101 %res = atomicrmw and i64 *%src, i64 -65538 seq_cst
105 ; Check the low end of the NILH range.
106 define i64 @f11(i64 %dummy, i64 *%src) {
110 %res = atomicrmw and i64 *%src, i64 -4294901761 seq_cst
114 ; Check the low end of the NILF range.
115 define i64 @f12(i64 %dummy, i64 *%src) {
119 %res = atomicrmw and i64 *%src, i64 -4294967296 seq_cst
123 ; Check the highest useful NIHL value, which is one less than the above.
124 define i64 @f13(i64 %dummy, i64 *%src) {
126 ; CHECK: nihl %r0, 65534
128 %res = atomicrmw and i64 *%src, i64 -4294967297 seq_cst
132 ; Check the low end of the NIHL range.
133 define i64 @f14(i64 %dummy, i64 *%src) {
137 %res = atomicrmw and i64 *%src, i64 -281470681743361 seq_cst
141 ; Check the highest useful NIHH value, which is 1<<32 less than the above.
142 define i64 @f15(i64 %dummy, i64 *%src) {
144 ; CHECK: nihh %r0, 65534
146 %res = atomicrmw and i64 *%src, i64 -281474976710657 seq_cst
150 ; Check the highest useful NIHF value, which is 1<<32 less than the above.
151 define i64 @f16(i64 %dummy, i64 *%src) {
153 ; CHECK: nihf %r0, 4294901758
155 %res = atomicrmw and i64 *%src, i64 -281479271677953 seq_cst