This patch adds support for the next-generation arch15 CPU architecture to the SystemZ backend. This includes: - Basic support for the new processor and its features. - Detection of arch15 as host processor. - Assembler/disassembler support for new instructions. - Exploitation of new instructions for code generation. - New vector (signed|unsigned|bool) __int128 data types. - New LLVM intrinsics for certain new instructions. - Support for low-level builtins mapped to new LLVM intrinsics. - New high-level intrinsics in vecintrin.h. - Indicate support by defining __VEC__ == 10305. Note: No currently available Z system supports the arch15 architecture. Once new systems become available, the official system name will be added as supported -march name.
99 lines
2.9 KiB
LLVM
99 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 LOGICAL INDEXED ADDRESS byte instructions.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=arch15 | FileCheck %s
|
|
|
|
; DO NOT USE: LLXAB with base and index.
|
|
define dso_local ptr @f0(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f0:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: algfr %r2, %r3
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = zext i32 %idx to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; DO NOT USE: LLXAB with base and index (implied extension).
|
|
define dso_local ptr @f1(ptr %ptr, i32 zeroext %idx) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: agr %r2, %r3
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = zext i32 %idx to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LLXAB with base and index and max displacement.
|
|
define dso_local ptr @f2(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: llxab %r2, 524287(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 524287
|
|
%idxprom = zext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; LLXAB with base and index and min displacement.
|
|
define dso_local ptr @f3(ptr %ptr, i32 %idx) {
|
|
; CHECK-LABEL: f3:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: llxab %r2, -524288(%r3,%r2)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, -524288
|
|
%idxprom = zext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; DO NOT USE: LLXAB 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: algfr %r2, %r3
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 524288
|
|
%idxprom = zext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; DO NOT USE: LLXAB 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: algfr %r2, %r3
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, -524289
|
|
%idxprom = zext i32 %idxoff to i64
|
|
%arrayidx = getelementptr inbounds i8, ptr %ptr, i64 %idxprom
|
|
ret ptr %arrayidx
|
|
}
|
|
|
|
; DO NOT USE: LLXAB with index.
|
|
define dso_local i64 @f6(i32 %idx) {
|
|
; CHECK-LABEL: f6:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: llgfr %r2, %r2
|
|
; CHECK-NEXT: br %r14
|
|
%idxprom = zext i32 %idx to i64
|
|
ret i64 %idxprom
|
|
}
|
|
|
|
; LLXAB with index and displacement.
|
|
define dso_local i64 @f7(i32 %idx) {
|
|
; CHECK-LABEL: f7:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: llxab %r2, 1(%r2,0)
|
|
; CHECK-NEXT: br %r14
|
|
%idxoff = add i32 %idx, 1
|
|
%idxprom = zext i32 %idxoff to i64
|
|
ret i64 %idxprom
|
|
}
|
|
|