blob: 7e28e231cfcd3d0f7413b8306b1f8adee83df686 [file] [log] [blame]
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00001; Test 32-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 i32 @f1(i32 %a) {
Stephen Lind24ab202013-07-14 06:24:09 +00007; CHECK-LABEL: f1:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00008; CHECK: xilf %r2, 1
9; CHECK: br %r14
10 %xor = xor i32 %a, 1
11 ret i32 %xor
12}
13
14; Check the high end of the signed range.
15define i32 @f2(i32 %a) {
Stephen Lind24ab202013-07-14 06:24:09 +000016; CHECK-LABEL: f2:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000017; CHECK: xilf %r2, 2147483647
18; CHECK: br %r14
19 %xor = xor i32 %a, 2147483647
20 ret i32 %xor
21}
22
23; Check the low end of the signed range, which should be treated
24; as a positive value.
25define i32 @f3(i32 %a) {
Stephen Lind24ab202013-07-14 06:24:09 +000026; CHECK-LABEL: f3:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000027; CHECK: xilf %r2, 2147483648
28; CHECK: br %r14
29 %xor = xor i32 %a, -2147483648
30 ret i32 %xor
31}
32
33; Check the high end of the XILF range.
34define i32 @f4(i32 %a) {
Stephen Lind24ab202013-07-14 06:24:09 +000035; CHECK-LABEL: f4:
Ulrich Weigand9e3577f2013-05-06 16:17:29 +000036; CHECK: xilf %r2, 4294967295
37; CHECK: br %r14
38 %xor = xor i32 %a, 4294967295
39 ret i32 %xor
40}