Jonas Paulsson 6d03f51f0c
[SystemZ] Add support for 16-bit floating point. (#109164)
- _Float16 is now accepted by Clang.

- The half IR type is fully handled by the backend.

- These values are passed in FP registers and converted to/from float around
  each operation.

- Compiler-rt conversion functions are now built for s390x including the missing
  extendhfdf2 which was added.

Fixes #50374
2025-04-16 20:02:56 +02:00

21 lines
588 B
LLVM

; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z16 | FileCheck %s
;
; Check that a multiply-and-add *not* result for half.
define half @f1(half %arg, half %A2, half %A3) {
; CHECK-LABEL: f1:
; CHECK: brasl %r14, __extendhfsf2@PLT
; CHECK: brasl %r14, __extendhfsf2@PLT
; CHECK: meebr %f0, %f10
; CHECK: brasl %r14, __truncsfhf2@PLT
; CHECK: brasl %r14, __extendhfsf2@PLT
; CHECK: brasl %r14, __extendhfsf2@PLT
; CHECK: wfasb %f0, %f9, %f0
; CHECK: brasl %r14, __truncsfhf2@PLT
bb:
%i = fmul contract half %arg, %A2
%i4 = fadd contract half %i, %A3
ret half %i4
}