This is an archive of the discontinued LLVM Phabricator instance.

[clang][ARM] follow GCC behavior for defining __SOFTFP__
ClosedPublic

Authored by stuij on Oct 11 2022, 7:59 AM.

Details

Summary

GCC behavior regarding defining SOFTFP when (implicitly) specifying
-mfloat-abi=softfp:

  • compile without (implicit) FP: define SOFTFP
  • compile with (implicit) FP: don't define SOFTFP

Currently Clang doesn't define SOFTFP when softfp is specified, either with
or without FP. This patch brings Clang in line with GCC behavior.

This was raised by itaig1 over on Github:
https://github.com/llvm/llvm-project/issues/55755

Diff Detail

Event Timeline

stuij created this revision.Oct 11 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 7:59 AM
stuij requested review of this revision.Oct 11 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 7:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
stuij edited the summary of this revision. (Show Details)Oct 11 2022, 8:18 AM
pratlucas added inline comments.Oct 13 2022, 7:21 AM
clang/test/Preprocessor/init-arm.c
404

I believe this RUN line won't covered the new condition added to clang/lib/Basic/Targets/ARM.cpp above, as it sets +soft-float.
Can you add an extra test without that option enabled?

stuij updated this revision to Diff 468495.Oct 18 2022, 5:22 AM

addressed review comment by adding test

stuij marked an inline comment as done.Oct 18 2022, 5:22 AM
stuij added inline comments.
clang/test/Preprocessor/init-arm.c
404

ah yes, thanks! added.

pratlucas accepted this revision.Oct 18 2022, 5:35 AM

Thanks! LGTM.

This revision is now accepted and ready to land.Oct 18 2022, 5:35 AM
This revision was automatically updated to reflect the committed changes.
stuij marked an inline comment as done.