[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

Trevor Gross via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 16:05:09 PDT 2025


================
@@ -3,6 +3,18 @@
 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
 
+; Test f16.
+declare half @llvm.fabs.f16(half %f)
+define half @f0(half %f) {
+; CHECK-LABEL: f0:
+; CHECK:      brasl %r14, __extendhfsf2 at PLT
+; CHECK-NEXT: lpdfr %f0, %f0
+; CHECK-NEXT: brasl %r14, __truncsfhf2 at PLT
+; CHECK: br %r14
----------------
tgross35 wrote:

Similarly `fabs `could be `a & !SIGN_MASK`. It looks like aarch64 uses this, x86 still seems to extend then truncate for whatever reason.

https://github.com/llvm/llvm-project/pull/109164


More information about the llvm-commits mailing list