This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Add basic Clang supports for M68881/2
ClosedPublic

Authored by myhsu on Apr 3 2023, 4:01 PM.

Details

Summary
  • Add the -m68881 flag
  • Add floating point feature detection
  • Macro definitions

To be honest this patch is not really urgent until we need inline assembly support and/or have decent amount of floating point instructions, but since it's a low-hanging fruit I just did it anyway.

Diff Detail

Event Timeline

myhsu created this revision.Apr 3 2023, 4:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 4:01 PM
myhsu requested review of this revision.Apr 3 2023, 4:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 4:01 PM
myhsu edited the summary of this revision. (Show Details)Apr 3 2023, 4:06 PM
RKSimon added inline comments.Apr 4 2023, 3:00 AM
clang/test/Driver/m68k-macros.cpp
2–9

Add a CHECK-NOMX881 prefix and check that HAVE_68881 isn't defined?

27

Add soft-float checks without CHECK-MX881 so we can check for 020-060 targets without FPU (68LC040 etc.)

myhsu updated this revision to Diff 511477.Apr 6 2023, 11:07 AM
myhsu marked 2 inline comments as done.
  • Explicit add isa-68882 even for newer (>=68040) CPUs. Such that's it's a lot easier to conditionally add related macro definitions with TargetOptions::FeatureMap
  • Add cases to test the absent of HAVE_68881 macro definitions

LGTM. Thanks !

0x59616e accepted this revision.Apr 22 2023, 6:47 PM
This revision is now accepted and ready to land.Apr 22 2023, 6:47 PM

@myhsu Can you fix the typo in the commit message?

s/supports/support/

This revision was automatically updated to reflect the committed changes.