Ulrich Weigand 8424bf207e [SystemZ] Add support for new cpu architecture - arch15
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.
2025-01-20 19:30:21 +01:00

59 lines
1.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; Test high-part i128->i256 multiplications on arch15.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=arch15 | FileCheck %s
; Multiply high signed.
define i128 @f1(i128 %a, i128 %b) {
; CHECK-LABEL: f1:
; CHECK: # %bb.0:
; CHECK-NEXT: vl %v0, 0(%r4), 3
; CHECK-NEXT: vl %v1, 0(%r3), 3
; CHECK-NEXT: vmhq %v0, %v1, %v0
; CHECK-NEXT: vst %v0, 0(%r2), 3
; CHECK-NEXT: br %r14
%exta = sext i128 %a to i256
%extb = sext i128 %b to i256
%extres = mul i256 %exta, %extb
%shiftres = lshr i256 %extres, 128
%res = trunc i256 %shiftres to i128
ret i128 %res
}
; Multiply high unsigned.
define i128 @f2(i128 %a, i128 %b) {
; CHECK-LABEL: f2:
; CHECK: # %bb.0:
; CHECK-NEXT: vl %v0, 0(%r4), 3
; CHECK-NEXT: vl %v1, 0(%r3), 3
; CHECK-NEXT: vmlhq %v0, %v1, %v0
; CHECK-NEXT: vst %v0, 0(%r2), 3
; CHECK-NEXT: br %r14
%exta = zext i128 %a to i256
%extb = zext i128 %b to i256
%extres = mul i256 %exta, %extb
%shiftres = lshr i256 %extres, 128
%res = trunc i256 %shiftres to i128
ret i128 %res
}
;; ; Multiply-and-add high signed.
;; define i128 @f3(i128 %a, i128 %b, i128 %add) {
;; ; CHECX-LABEL: f3:
;; ; CHECX: # %bb.0:
;; ; CHECX-NEXT: vl %v0, 0(%r3), 3
;; ; CHECX-NEXT: vl %v1, 0(%r4), 3
;; ; CHECX-NEXT: vl %v2, 0(%r5), 3
;; ; CHECX-NEXT: vmhq %v0, %v0, %v1, %v2
;; ; CHECX-NEXT: vst %v0, 0(%r2), 3
;; ; CHECX-NEXT: br %r14
;; %exta = sext i128 %a to i256
;; %extb = sext i128 %b to i256
;; %extadd = sext i128 %add to i256
;; %extmul = mul i256 %exta, %extb
;; %extres = add i256 %extmul, %extadd
;; %shiftres = lshr i256 %extres, 128
;; %res = trunc i256 %shiftres to i128
;; ret i128 %res
;; }