Skip to content

Commit 3a44be2

Browse files
perry-caAnthony Tran
authored andcommitted
[SystemZ][zOS] disable _Float16 support on z/OS (llvm#145532)
The new half float type (aka _Float16 ) isn't supported on z/OS.
1 parent 9eeb416 commit 3a44be2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

clang/lib/Basic/Targets/SystemZ.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
9090
resetDataLayout("E-m:l-p1:32:32-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-"
9191
"a:8:16-n32:64");
9292
} else {
93+
// Support _Float16.
94+
HasFloat16 = true;
9395
TLSSupported = true;
9496
resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64"
9597
"-v128:64-a:8:16-n32:64");
@@ -103,8 +105,6 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
103105
// and instead the backend will promote each half operation to float
104106
// individually.
105107
HasLegalHalfType = false;
106-
// Support _Float16.
107-
HasFloat16 = true;
108108

109109
HasStrictFP = true;
110110
}

clang/test/Sema/Float16.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
77
// RUN: %clang_cc1 -fsyntax-only -verify -triple riscv32 %s -DHAVE
88
// RUN: %clang_cc1 -fsyntax-only -verify -triple riscv64 %s -DHAVE
9+
// RUN: %clang_cc1 -fsyntax-only -verify -triple s390x-ibm-zos %s
910

1011
#ifndef HAVE
1112
// expected-error@+2{{_Float16 is not supported on this target}}

clang/test/SemaCXX/Float16.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
55
// RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
66
// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
7-
7+
// RUN: %clang_cc1 -fsyntax-only -verify -triple s390x-ibm-zos %s
88
#ifdef HAVE
99
// expected-no-diagnostics
1010
#endif // HAVE

0 commit comments

Comments
 (0)