blob: 377a3e604c60cafb931bfc7b6e5278b309acb5ab [file] [log] [blame]
Ulrich Weigand9e3577f2013-05-06 16:17:29 +00001; Test 32-bit ORs in which the second operand is constant.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5; Check the lowest useful OILL value.
6define i32 @f1(i32 %a) {
7; CHECK: f1:
8; CHECK: oill %r2, 1
9; CHECK: br %r14
10 %or = or i32 %a, 1
11 ret i32 %or
12}
13
14; Check the high end of the OILL range.
15define i32 @f2(i32 %a) {
16; CHECK: f2:
17; CHECK: oill %r2, 65535
18; CHECK: br %r14
19 %or = or i32 %a, 65535
20 ret i32 %or
21}
22
23; Check the lowest useful OILH range, which is the next value up.
24define i32 @f3(i32 %a) {
25; CHECK: f3:
26; CHECK: oilh %r2, 1
27; CHECK: br %r14
28 %or = or i32 %a, 65536
29 ret i32 %or
30}
31
32; Check the lowest useful OILF value, which is the next value up again.
33define i32 @f4(i32 %a) {
34; CHECK: f4:
35; CHECK: oilf %r2, 65537
36; CHECK: br %r14
37 %or = or i32 %a, 65537
38 ret i32 %or
39}
40
41; Check the high end of the OILH range.
42define i32 @f5(i32 %a) {
43; CHECK: f5:
44; CHECK: oilh %r2, 65535
45; CHECK: br %r14
46 %or = or i32 %a, -65536
47 ret i32 %or
48}
49
50; Check the next value up, which must use OILF instead.
51define i32 @f6(i32 %a) {
52; CHECK: f6:
53; CHECK: oilf %r2, 4294901761
54; CHECK: br %r14
55 %or = or i32 %a, -65535
56 ret i32 %or
57}
58
59; Check the highest useful OILF value.
60define i32 @f7(i32 %a) {
61; CHECK: f7:
62; CHECK: oilf %r2, 4294967294
63; CHECK: br %r14
64 %or = or i32 %a, -2
65 ret i32 %or
66}