-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][Driver] Define soft float macros for PPC. #106012
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
Conversation
@llvm/pr-subscribers-backend-powerpc @llvm/pr-subscribers-clang Author: Alex Rønne Petersen (alexrp) ChangesFixes #105972. Full diff: https://github.com/llvm/llvm-project/pull/106012.diff 1 Files Affected:
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 04dc436eb1b9cd..91145b256804c7 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -402,9 +402,13 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__VEC__", "10206");
Builder.defineMacro("__ALTIVEC__");
}
- if (HasSPE) {
+ if (HasSPE)
Builder.defineMacro("__SPE__");
+ if (HasSPE || FloatABI == SoftFloat)
Builder.defineMacro("__NO_FPRS__");
+ if (FloatABI == SoftFloat) {
+ Builder.defineMacro("_SOFT_FLOAT");
+ Builder.defineMacro("_SOFT_DOUBLE");
}
if (HasVSX)
Builder.defineMacro("__VSX__");
@@ -439,14 +443,12 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
// FIXME: The following are not yet generated here by Clang, but are
// generated by GCC:
//
- // _SOFT_FLOAT_
// __RECIP_PRECISION__
// __APPLE_ALTIVEC__
// __RECIP__
// __RECIPF__
// __RSQRTE__
// __RSQRTEF__
- // _SOFT_DOUBLE_
// __NO_LWSYNC__
// __CMODEL_MEDIUM__
// __CMODEL_LARGE__
|
FWIW, if this patch is good, it would be nice if we could get it into 19.x since we're affected by it in Zig. |
Could you pick the test change from ecnelises@9dcb9c9 into this patch? |
5d52fe0
to
885a183
Compare
@ecnelises done, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
b9e8103
to
acd4bd9
Compare
Fixes llvm#105972. Co-authored-by: Qiu Chaofan <[email protected]>
acd4bd9
to
4f766ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Thanks very much for the fix.
Forgot to note in the PR description that I don't have commit access. |
Fixes #105972.