70 lines · plain
1; Test 64-bit XORs in which the second operand is constant.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s4 5; Check the lowest useful XILF value.6define i64 @f1(i64 %a) {7; CHECK-LABEL: f1:8; CHECK: xilf %r2, 19; CHECK: br %r1410 %xor = xor i64 %a, 111 ret i64 %xor12}13 14; Check the high end of the XILF range.15define i64 @f2(i64 %a) {16; CHECK-LABEL: f2:17; CHECK: xilf %r2, 429496729518; CHECK: br %r1419 %xor = xor i64 %a, 429496729520 ret i64 %xor21}22 23; Check the lowest useful XIHF value, which is one up from the above.24define i64 @f3(i64 %a) {25; CHECK-LABEL: f3:26; CHECK: xihf %r2, 127; CHECK: br %r1428 %xor = xor i64 %a, 429496729629 ret i64 %xor30}31 32; Check the next value up again, which needs a combination of XIHF and XILF.33define i64 @f4(i64 %a) {34; CHECK-LABEL: f4:35; CHECK: xihf %r2, 136; CHECK: xilf %r2, 429496729537; CHECK: br %r1438 %xor = xor i64 %a, 858993459139 ret i64 %xor40}41 42; Check the high end of the XIHF range.43define i64 @f5(i64 %a) {44; CHECK-LABEL: f5:45; CHECK: xihf %r2, 429496729546; CHECK: br %r1447 %xor = xor i64 %a, -429496729648 ret i64 %xor49}50 51; Check the next value up, which again must use XIHF and XILF.52define i64 @f6(i64 %a) {53; CHECK-LABEL: f6:54; CHECK: xihf %r2, 429496729555; CHECK: xilf %r2, 156; CHECK: br %r1457 %xor = xor i64 %a, -429496729558 ret i64 %xor59}60 61; Check full bitwise negation62define i64 @f7(i64 %a) {63; CHECK-LABEL: f7:64; CHECK: lcgr %r2, %r265; CHECK: aghi %r2, -166; CHECK: br %r1467 %xor = xor i64 %a, -168 ret i64 %xor69}70