• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test 64-bit XORs in which the second operand is constant.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5; Check the lowest useful XILF value.
6define i64 @f1(i64 %a) {
7; CHECK-LABEL: f1:
8; CHECK: xilf %r2, 1
9; CHECK: br %r14
10  %xor = xor i64 %a, 1
11  ret i64 %xor
12}
13
14; Check the high end of the XILF range.
15define i64 @f2(i64 %a) {
16; CHECK-LABEL: f2:
17; CHECK: xilf %r2, 4294967295
18; CHECK: br %r14
19  %xor = xor i64 %a, 4294967295
20  ret i64 %xor
21}
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, 1
27; CHECK: br %r14
28  %xor = xor i64 %a, 4294967296
29  ret i64 %xor
30}
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, 1
36; CHECK: xilf %r2, 4294967295
37; CHECK: br %r14
38  %xor = xor i64 %a, 8589934591
39  ret i64 %xor
40}
41
42; Check the high end of the XIHF range.
43define i64 @f5(i64 %a) {
44; CHECK-LABEL: f5:
45; CHECK: xihf %r2, 4294967295
46; CHECK: br %r14
47  %xor = xor i64 %a, -4294967296
48  ret i64 %xor
49}
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, 4294967295
55; CHECK: xilf %r2, 1
56; CHECK: br %r14
57  %xor = xor i64 %a, -4294967295
58  ret i64 %xor
59}
60
61; Check full bitwise negation
62define i64 @f7(i64 %a) {
63; CHECK-LABEL: f7:
64; CHECK: xihf %r2, 4294967295
65; CHECK: xilf %r2, 4294967295
66; CHECK: br %r14
67  %xor = xor i64 %a, -1
68  ret i64 %xor
69}
70