The recently announced IBM z17 processor implements the architecture already supported as "arch15" in LLVM. This patch adds support for "z17" as an alternate architecture name for arch15. This patch also add the scheduler description for the z17 processor, provided by Jonas Paulsson.
101 lines
2.9 KiB
LLVM
101 lines
2.9 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
|
|
; Test use of LOAD INDEXED ADDRESS doubleword instructions.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z17 | FileCheck %s
|
|
|
|
; LXAG with base and index.
|
|
define dso_local ptr @f0(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f0:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, 0(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = sext i32 %idx to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with base and index (implied extension).
|
|
define dso_local ptr @f1(ptr %ptr, i32 signext %idx) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, 0(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = sext i32 %idx to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with base and index and max displacement.
|
|
define dso_local ptr @f2(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, 524287(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 524287
|
|
%idxprom = sext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with base and index and min displacement.
|
|
define dso_local ptr @f3(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f3:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, -524288(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, -524288
|
|
%idxprom = sext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with base and index and max displacement overflow.
|
|
define dso_local ptr @f4(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f4:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: afi %r3, 524288
|
|
; CHECK-NEXT: lxag %r2, 0(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 524288
|
|
%idxprom = sext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with base and index and min displacement overflow.
|
|
define dso_local ptr @f5(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f5:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: afi %r3, -524289
|
|
; CHECK-NEXT: lxag %r2, 0(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, -524289
|
|
%idxprom = sext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i64, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LXAG with index.
|
|
define dso_local i64 @f6(i32 %idx) {
|
|
; CHECK-LABEL: f6:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, 0(%r2,0)
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = sext i32 %idx to i64
|
|
%idxshift = shl i64 %idxprom, 3
|
|
ret i64 %idxshift
|
|
}
|
|
|
|
; LXAG with index and displacement.
|
|
define dso_local i64 @f7(i32 %idx) {
|
|
; CHECK-LABEL: f7:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lxag %r2, 1(%r2,0)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 1
|
|
%idxprom = sext i32 %idxoff to i64
|
|
%idxshift = shl i64 %idxprom, 3
|
|
ret i64 %idxshift
|
|
}
|
|
|