Skip to content

[SystemZ][zOS] disable _Float16 support on z/OS #145532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/lib/Basic/Targets/SystemZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
resetDataLayout("E-m:l-p1:32:32-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-"
"a:8:16-n32:64");
} else {
// Support _Float16.
HasFloat16 = true;
TLSSupported = true;
resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64"
"-v128:64-a:8:16-n32:64");
Expand All @@ -102,8 +104,6 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
// and instead the backend will promote each half operation to float
// individually.
HasLegalHalfType = false;
// Support _Float16.
HasFloat16 = true;

HasStrictFP = true;
}
Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/Float16.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple riscv32 %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple riscv64 %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple s390x-ibm-zos %s

#ifndef HAVE
// expected-error@+2{{_Float16 is not supported on this target}}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/Float16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE

// RUN: %clang_cc1 -fsyntax-only -verify -triple s390x-ibm-zos %s
#ifdef HAVE
// expected-no-diagnostics
#endif // HAVE
Expand Down