Page MenuHomePhabricator

[ARM] Add ACLE feature macros for MVE.
ClosedPublic

Authored by SjoerdMeijer on Apr 15 2019, 6:01 AM.

Details

Summary

If MVE is present at all, then the macro __ARM_FEATURE_MVE is defined
to a value which has bit 0 set for integer MVE, and bit 1 set for
floating-point MVE.

(Floating-point MVE implies integer MVE, so if this macro is defined
at all then it will be set to 1 or 3, never 2.)

Event Timeline

simon_tatham created this revision.Apr 15 2019, 6:01 AM

Could you add some tests?

SjoerdMeijer commandeered this revision.Fri, Jun 7, 1:25 AM
SjoerdMeijer updated this revision to Diff 203507.
SjoerdMeijer edited reviewers, added: simon_tatham; removed: SjoerdMeijer.

Added tests

ostannard added inline comments.Fri, Jun 7, 2:02 AM
clang/lib/Basic/Targets/ARM.cpp
460

Does this also need to set FPU and HasLegalHalfType?

SjoerdMeijer marked an inline comment as done.Fri, Jun 7, 2:57 AM
SjoerdMeijer added inline comments.
clang/lib/Basic/Targets/ARM.cpp
460

Yep, thanks for catching this one, will fix this.

Set FullFP16 for +mve.fp

ostannard added inline comments.Fri, Jun 7, 5:24 AM
clang/lib/Basic/Targets/ARM.cpp
460

What about FPU? mve.fp requires that the FPU is also enabled, so we should also get the __ARM_FPV5__ macro (unless we're adding a new one for the v8.1M FPU?).

Yep, sorry, missed that one.

This revision is now accepted and ready to land.Fri, Jun 7, 7:50 AM

Thanks for reviewing!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFri, Jun 7, 8:21 AM

The test is failing on some bots, e.g. http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/13430/steps/test-stage1-compiler/logs/stdio

/home/buildslave/buildslave1a/clang-with-lto-ubuntu/llvm.src/tools/clang/test/Preprocessor/arm-target-features.c:762:20: error: CHECK-V81M-MVE: expected string not found in input
// CHECK-V81M-MVE: #define __ARM_FEATURE_MVE 1
                   ^
<stdin>:16:1: note: scanning from here
#define __ARM_FEATURE_FMA 1
^
<stdin>:20:1: note: possible intended match here
#define __ARM_FEATURE_MVE 3
^

Hello. Hopefully fixed in rC362814!