1 ; Test 32-bit addition in which the second operand is constant and in which
2 ; three-operand forms are available.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
6 ; Check additions of 1.
7 define i32 @f1(i32 %a, i32 %b) {
9 ; CHECK: ahik %r2, %r3, 1
15 ; Check the high end of the AHIK range.
16 define i32 @f2(i32 %a, i32 %b) {
18 ; CHECK: ahik %r2, %r3, 32767
20 %add = add i32 %b, 32767
24 ; Check the next value up, which must use AFI instead.
25 define i32 @f3(i32 %a, i32 %b) {
27 ; CHECK: afi {{%r[0-5]}}, 32768
29 %add = add i32 %b, 32768
33 ; Check the high end of the negative AHIK range.
34 define i32 @f4(i32 %a, i32 %b) {
36 ; CHECK: ahik %r2, %r3, -1
42 ; Check the low end of the AHIK range.
43 define i32 @f5(i32 %a, i32 %b) {
45 ; CHECK: ahik %r2, %r3, -32768
47 %add = add i32 %b, -32768
51 ; Check the next value down, which must use AFI instead.
52 define i32 @f6(i32 %a, i32 %b) {
54 ; CHECK: afi {{%r[0-5]}}, -32769
56 %add = add i32 %b, -32769
60 ; Check that AHI is still used in obvious cases.
61 define i32 @f7(i32 %a) {