brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ee5fc1c Raw
79 lines · plain
1; Test 64-bit atomic XORs.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s4 5; Check XORs of a variable.6define i64 @f1(i64 %dummy, ptr %src, i64 %b) {7; CHECK-LABEL: f1:8; CHECK: lg %r2, 0(%r3)9; CHECK: [[LABEL:\.[^ ]*]]:10; CHECK: lgr %r0, %r211; CHECK: xgr %r0, %r412; CHECK: csg %r2, %r0, 0(%r3)13; CHECK: jl [[LABEL]]14; CHECK: br %r1415  %res = atomicrmw xor ptr %src, i64 %b seq_cst16  ret i64 %res17}18 19; Check the lowest useful XILF value.20define i64 @f2(i64 %dummy, ptr %src) {21; CHECK-LABEL: f2:22; CHECK: lg %r2, 0(%r3)23; CHECK: [[LABEL:\.[^ ]*]]:24; CHECK: lgr %r0, %r225; CHECK: xilf %r0, 126; CHECK: csg %r2, %r0, 0(%r3)27; CHECK: jl [[LABEL]]28; CHECK: br %r1429  %res = atomicrmw xor ptr %src, i64 1 seq_cst30  ret i64 %res31}32 33; Check the high end of the XILF range.34define i64 @f3(i64 %dummy, ptr %src) {35; CHECK-LABEL: f3:36; CHECK: xilf %r0, 429496729537; CHECK: br %r1438  %res = atomicrmw xor ptr %src, i64 4294967295 seq_cst39  ret i64 %res40}41 42; Check the lowest useful XIHF value, which is one greater than above.43define i64 @f4(i64 %dummy, ptr %src) {44; CHECK-LABEL: f4:45; CHECK: xihf %r0, 146; CHECK: br %r1447  %res = atomicrmw xor ptr %src, i64 4294967296 seq_cst48  ret i64 %res49}50 51; Check the next value up.52define i64 @f5(i64 %dummy, ptr %src) {53; CHECK-LABEL: f5:54; CHECK: xihf %r0, 155; CHECK: xilf %r0, 156; CHECK: br %r1457  %res = atomicrmw xor ptr %src, i64 4294967297 seq_cst58  ret i64 %res59}60 61; Check the high end of the XIHF range.62define i64 @f6(i64 %dummy, ptr %src) {63; CHECK-LABEL: f6:64; CHECK: xihf %r0, 429496729565; CHECK: br %r1466  %res = atomicrmw xor ptr %src, i64 -4294967296 seq_cst67  ret i64 %res68}69 70; Check the next value up, which must use a register.71define i64 @f7(i64 %dummy, ptr %src) {72; CHECK-LABEL: f7:73; CHECK: xihf %r0, 429496729574; CHECK: xilf %r0, 175; CHECK: br %r1476  %res = atomicrmw xor ptr %src, i64 -4294967295 seq_cst77  ret i64 %res78}79