This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MVE] MVE-I should not be disabled by -mfpu=none
ClosedPublic

Authored by chill on Dec 23 2019, 9:12 AM.

Details

Summary

Architecturally, it's allowed to MVE-I without an FPU, thus -mfpu=none should
not disable MVE-I or moves to/from FP-registers.

This patch removes +/-fpregs from features unconditionally added to target
feature list, depending on FPU and moves the logic to Clang driver, where the
negative form (-fpregs) is conditionally added to the target features list for
the cases of -mfloat-abi=soft, or -mfpu=none without either
+mve or +mve.fp. Only the negative form is added by the driver, the positive
one is derived from other features in the backend.

Diff Detail

Event Timeline

chill created this revision.Dec 23 2019, 9:12 AM
simon_tatham added inline comments.Jan 6 2020, 7:18 AM
clang/test/Driver/arm-mfpu.c
410

I'm confused by this.

A set of target-feature options that turn off fpregs, when parsed by LLVM which knows the target-feature dependencies, will surely also disable even integer MVE, because the FP regs are also the MVE vector regs.

But if I start with full MVE (both integer and float), and I say -mfpu=none to disable float MVE, then surely I should expect integer MVE to still be enabled, and therefore fpregs should still be there to support it?

chill updated this revision to Diff 236544.Jan 7 2020, 3:28 AM
chill edited the summary of this revision. (Show Details)
chill marked an inline comment as done.
simon_tatham accepted this revision.Jan 7 2020, 6:17 AM

LGTM, with a request for an extra comment.

clang/lib/Driver/ToolChains/Arch/ARM.cpp
471

This confused me on the first three readings – you carefully add -mve.fp, and then test whether +mve.fp is in the list?

It made sense to me on the fourth reading. If I've understood correctly, the point is that if mve.fp was previously enabled, and we have just disabled it, then mve (integer-only) is still required, and hence, so are fpregs. And the same goes if mve itself is enabled in the feature list.

So I think this is right, but I also think it could use a comment spelling out the reasoning.

This revision is now accepted and ready to land.Jan 7 2020, 6:17 AM
chill updated this revision to Diff 237046.Jan 9 2020, 6:01 AM
chill edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2020, 6:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript