Page MenuHomePhabricator

[ARM] Add ACLE feature macros for MVE.

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



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.)

Diff Detail


Event Timeline

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

Could you add some tests?

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

Added tests

ostannard added inline comments.Jun 7 2019, 2:02 AM
465 ↗(On Diff #203507)

Does this also need to set FPU and HasLegalHalfType?

SjoerdMeijer marked an inline comment as done.Jun 7 2019, 2:57 AM
SjoerdMeijer added inline comments.
465 ↗(On Diff #203507)

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

Set FullFP16 for +mve.fp

ostannard added inline comments.Jun 7 2019, 5:24 AM
465 ↗(On Diff #203507)

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.Jun 7 2019, 7:50 AM

Thanks for reviewing!

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

The test is failing on some bots, e.g.

/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!