-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[discussion] Decide whether or not to express FPU nuances for @platforms//cpu:armv*-m*
constraints
#100
Comments
This sounds very reasonable to me, but no one on the team has any deep knowledge about ARM and how these things are handled. I'm going to send this to the Slack to see if anyone there has an opinion, and if we don't hear back this sounds like a reasonable approach. |
Agreed. The various features which pop up in each architecture should be listed as individual constraints. I would be happy seeing cpu/arm/BUILD, cpu/x86/BUILD, cpu/riscv/BUILD, ... and so on to hold the names of platform specific features. Then people can build up their own hardware specific platforms from those. |
I like the idea of having |
I agree that I'll attempt to find a relevant expert within Arm to advise. |
A few other ideas that have come up in side discussions: Create base platforms for projects to useSince expressivity gets a tad more complicated with these, we could create platforms that projects could inherit from:
Build compiler flags based on theseAnother idea I was sitting on was constructing a -mcpu flag based on these. The "how" isn't the most obvious for a couple reasons:
At the end of the day, what I'd like is something like:
But implementing that might not be quite so trivial. Also note that I'm using |
The general concensus internally at Arm (who are not huge users of Bazel) is "do whatever the compilers do". @armandomontanez basing constraints on what the compilers can enable with |
We may want to avoid expressing FPU extensions in ARM Cortex-M CPU constraints.
Proposal
Refrain from extending the set of
@platforms//cpu:armv*-mf
constraints, and annotate the existing constraint with a warning that it is kept around for compatibility reasons and shouldn't be carried forwards as a pattern.Why?
ARMv7e-M + FPU is relatively ambiguous:
Cortex-M4 (ARMv7e-M) optionally supports FPU instructions via the FPv4-SP extension
Cortex-M7 (ARMv7e-M) optionally supports FPU instructions via the FPv5-SP-D16-M or FPv5-DP-D16-M extensions
These aren't the only optional extensions for Cortex-M processors either, so properly fully enumerating the extensions is a bit of a hassle when it comes to basic CPU constraints. It's a bit like having
@platforms//cpu:x86_64-AVX512
. It's likely best to leave these nuances to separate constraints that add dimensions rather than trying to enumerate every configuration across a single dimension. I don't necessarily think we should prescribe a solution for expressing architecture extensions, but I do think we should consider annotating the existing@platforms//cpu:armv7e-mf
with a warning that it shouldn't be replicated but will be retained for backwards compatibility.The text was updated successfully, but these errors were encountered: