1 ; Test the "S" asm constraint, which accepts addresses that have a base 2 ; and a 20-bit displacement. 3 ; 4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -no-integrated-as | FileCheck %s 5 6 ; Check the lowest range. 7 define void @f1(i64 %base) { 8 ; CHECK-LABEL: f1: 9 ; CHECK: blah -524288(%r2) 10 ; CHECK: br %r14 11 %add = add i64 %base, -524288 12 %addr = inttoptr i64 %add to i64 * 13 call void asm "blah $0", "=*S" (i64 *%addr) 14 ret void 15 } 16 17 ; Check the next lowest byte. 18 define void @f2(i64 %base) { 19 ; CHECK-LABEL: f2: 20 ; CHECK: agfi %r2, -524289 21 ; CHECK: blah 0(%r2) 22 ; CHECK: br %r14 23 %add = add i64 %base, -524289 24 %addr = inttoptr i64 %add to i64 * 25 call void asm "blah $0", "=*S" (i64 *%addr) 26 ret void 27 } 28 29 ; Check the highest range. 30 define void @f3(i64 %base) { 31 ; CHECK-LABEL: f3: 32 ; CHECK: blah 524287(%r2) 33 ; CHECK: br %r14 34 %add = add i64 %base, 524287 35 %addr = inttoptr i64 %add to i64 * 36 call void asm "blah $0", "=*S" (i64 *%addr) 37 ret void 38 } 39 40 ; Check the next highest byte. 41 define void @f4(i64 %base) { 42 ; CHECK-LABEL: f4: 43 ; CHECK: agfi %r2, 524288 44 ; CHECK: blah 0(%r2) 45 ; CHECK: br %r14 46 %add = add i64 %base, 524288 47 %addr = inttoptr i64 %add to i64 * 48 call void asm "blah $0", "=*S" (i64 *%addr) 49 ret void 50 } 51