1 ; Test 32-bit addition in which the second operand is constant.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Check additions of 1.
6 define i32 @f1(i32 %a) {
14 ; Check the high end of the AHI range.
15 define i32 @f2(i32 %a) {
17 ; CHECK: ahi %r2, 32767
19 %add = add i32 %a, 32767
23 ; Check the next value up, which must use AFI instead.
24 define i32 @f3(i32 %a) {
26 ; CHECK: afi %r2, 32768
28 %add = add i32 %a, 32768
32 ; Check the high end of the signed 32-bit range.
33 define i32 @f4(i32 %a) {
35 ; CHECK: afi %r2, 2147483647
37 %add = add i32 %a, 2147483647
41 ; Check the next value up, which is treated as a negative value.
42 define i32 @f5(i32 %a) {
44 ; CHECK: afi %r2, -2147483648
46 %add = add i32 %a, 2147483648
50 ; Check the high end of the negative AHI range.
51 define i32 @f6(i32 %a) {
59 ; Check the low end of the AHI range.
60 define i32 @f7(i32 %a) {
62 ; CHECK: ahi %r2, -32768
64 %add = add i32 %a, -32768
68 ; Check the next value down, which must use AFI instead.
69 define i32 @f8(i32 %a) {
71 ; CHECK: afi %r2, -32769
73 %add = add i32 %a, -32769
77 ; Check the low end of the signed 32-bit range.
78 define i32 @f9(i32 %a) {
80 ; CHECK: afi %r2, -2147483648
82 %add = add i32 %a, -2147483648
86 ; Check the next value down, which is treated as a positive value.
87 define i32 @f10(i32 %a) {
89 ; CHECK: afi %r2, 2147483647
91 %add = add i32 %a, -2147483649