brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 2c57556 Raw
99 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; Test use of LOAD LOGICAL INDEXED ADDRESS byte instructions.3;4; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z17 | FileCheck %s5 6; DO NOT USE: LLXAB with base and index.7define dso_local ptr @f0(ptr %ptr, i32 %idx) {8; CHECK-LABEL: f0:9; CHECK:       # %bb.0:10; CHECK-NEXT:    algfr %r2, %r311; CHECK-NEXT:    br %r1412  %idxprom = zext i32 %idx to i6413  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom14  ret ptr %arrayidx15}16 17; DO NOT USE: LLXAB with base and index (implied extension).18define dso_local ptr @f1(ptr %ptr, i32 zeroext %idx) {19; CHECK-LABEL: f1:20; CHECK:       # %bb.0:21; CHECK-NEXT:    agr %r2, %r322; CHECK-NEXT:    br %r1423  %idxprom = zext i32 %idx to i6424  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom25  ret ptr %arrayidx26}27 28; LLXAB with base and index and max displacement.29define dso_local ptr @f2(ptr %ptr, i32 %idx) {30; CHECK-LABEL: f2:31; CHECK:       # %bb.0:32; CHECK-NEXT:    llxab %r2, 524287(%r3,%r2)33; CHECK-NEXT:    br %r1434  %idxoff = add i32 %idx, 52428735  %idxprom = zext i32 %idxoff to i6436  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom37  ret ptr %arrayidx38}39 40; LLXAB with base and index and min displacement.41define dso_local ptr @f3(ptr %ptr, i32 %idx) {42; CHECK-LABEL: f3:43; CHECK:       # %bb.0:44; CHECK-NEXT:    llxab %r2, -524288(%r3,%r2)45; CHECK-NEXT:    br %r1446  %idxoff = add i32 %idx, -52428847  %idxprom = zext i32 %idxoff to i6448  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom49  ret ptr %arrayidx50}51 52; DO NOT USE: LLXAB with base and index and max displacement overflow.53define dso_local ptr @f4(ptr %ptr, i32 %idx) {54; CHECK-LABEL: f4:55; CHECK:       # %bb.0:56; CHECK-NEXT:    afi %r3, 52428857; CHECK-NEXT:    algfr %r2, %r358; CHECK-NEXT:    br %r1459  %idxoff = add i32 %idx, 52428860  %idxprom = zext i32 %idxoff to i6461  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom62  ret ptr %arrayidx63}64 65; DO NOT USE: LLXAB with base and index and min displacement overflow.66define dso_local ptr @f5(ptr %ptr, i32 %idx) {67; CHECK-LABEL: f5:68; CHECK:       # %bb.0:69; CHECK-NEXT:    afi %r3, -52428970; CHECK-NEXT:    algfr %r2, %r371; CHECK-NEXT:    br %r1472  %idxoff = add i32 %idx, -52428973  %idxprom = zext i32 %idxoff to i6474  %arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom75  ret ptr %arrayidx76}77 78; DO NOT USE: LLXAB with index.79define dso_local i64 @f6(i32 %idx) {80; CHECK-LABEL: f6:81; CHECK:       # %bb.0:82; CHECK-NEXT:    llgfr %r2, %r283; CHECK-NEXT:    br %r1484  %idxprom = zext i32 %idx to i6485  ret i64 %idxprom86}87 88; LLXAB with index and displacement.89define dso_local i64 @f7(i32 %idx) {90; CHECK-LABEL: f7:91; CHECK:       # %bb.0:92; CHECK-NEXT:    llxab %r2, 1(%r2,0)93; CHECK-NEXT:    br %r1494  %idxoff = add i32 %idx, 195  %idxprom = zext i32 %idxoff to i6496  ret i64 %idxprom97}98 99