brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 96c82e6 Raw
86 lines · plain
1; Test 32-bit atomic ANDs.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s4 5; Check ANDs of a variable.6define i32 @f1(i32 %dummy, ptr %src, i32 %b) {7; CHECK-LABEL: f1:8; CHECK: l %r2, 0(%r3)9; CHECK: [[LABEL:\.[^ ]*]]:10; CHECK: lr %r0, %r211; CHECK: nr %r0, %r412; CHECK: cs %r2, %r0, 0(%r3)13; CHECK: jl [[LABEL]]14; CHECK: br %r1415  %res = atomicrmw and ptr %src, i32 %b seq_cst16  ret i32 %res17}18 19; Check ANDs of 1.20define i32 @f2(i32 %dummy, ptr %src) {21; CHECK-LABEL: f2:22; CHECK: l %r2, 0(%r3)23; CHECK: [[LABEL:\.[^ ]*]]:24; CHECK: lr %r0, %r225; CHECK: nilf %r0, 126; CHECK: cs %r2, %r0, 0(%r3)27; CHECK: jl [[LABEL]]28; CHECK: br %r1429  %res = atomicrmw and ptr %src, i32 1 seq_cst30  ret i32 %res31}32 33; Check ANDs of the low end of the NILH range.34define i32 @f3(i32 %dummy, ptr %src) {35; CHECK-LABEL: f3:36; CHECK: llhr %r0, %r237; CHECK: br %r1438  %res = atomicrmw and ptr %src, i32 65535 seq_cst39  ret i32 %res40}41 42; Check the next value up, which must use NILF.43define i32 @f4(i32 %dummy, ptr %src) {44; CHECK-LABEL: f4:45; CHECK: nilf %r0, 6553646; CHECK: br %r1447  %res = atomicrmw and ptr %src, i32 65536 seq_cst48  ret i32 %res49}50 51; Check the largest useful NILL value.52define i32 @f5(i32 %dummy, ptr %src) {53; CHECK-LABEL: f5:54; CHECK: nill %r0, 6553455; CHECK: br %r1456  %res = atomicrmw and ptr %src, i32 -2 seq_cst57  ret i32 %res58}59 60; Check the low end of the NILL range.61define i32 @f6(i32 %dummy, ptr %src) {62; CHECK-LABEL: f6:63; CHECK: nill %r0, 064; CHECK: br %r1465  %res = atomicrmw and ptr %src, i32 -65536 seq_cst66  ret i32 %res67}68 69; Check the largest useful NILH value, which is one less than the above.70define i32 @f7(i32 %dummy, ptr %src) {71; CHECK-LABEL: f7:72; CHECK: nilh %r0, 6553473; CHECK: br %r1474  %res = atomicrmw and ptr %src, i32 -65537 seq_cst75  ret i32 %res76}77 78; Check the highest useful NILF value, which is one less than the above.79define i32 @f8(i32 %dummy, ptr %src) {80; CHECK-LABEL: f8:81; CHECK: nilf %r0, 429490175882; CHECK: br %r1483  %res = atomicrmw and ptr %src, i32 -65538 seq_cst84  ret i32 %res85}86