Skip to content
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] Deprecate //cpu:armv8-m in favor of //cpu:armv8-m.main #104

Open
armandomontanez opened this issue Sep 20, 2024 · 3 comments
Open

Comments

@armandomontanez
Copy link

Similar to #100, I'm looking to tidy up some pre-existing Cortex-M CPU expressions here.

Proposal

Mark //cpu:armv8-m as deprecated, and introduce //cpu:armv8-m.base and //cpu:armv8-m.main.

Why?

ARMv8-M is technically split into two distinctly different ISAs: armv8-m.main and armv8-m.base. The baseline variant of ARMv8-M is more akin to ARMv6-M than ARMv7E-M. Also, when spelling -march, there is no such option for armv8-m. The flavors are either armv8-m.base or armv8-m.main. Note that these flavors are not traditionally considered extensions (unlike FPU or DSP instructions).

Also, this naming carries forward with the armv8.1-m.main architecture, even though it doesn't have a armv8.1-m.base variant.

@armandomontanez
Copy link
Author

Perhaps there's an argument to be made that we should just jump ship entirely on this expression, and use the names available for -mcpu. They're more granular, and better express exactly what you're targeting. You can infer the -march names from -mcpu but not the other way around.

@armandomontanez
Copy link
Author

It looks like @aiuto already clarified that we should be using the CPU type itself (rather than ISA) moving forward: 0f056b5

For now, I think the answer is to pivot to adding:

  • @platforms//cpu:cortex-m3
  • @platforms//cpu:cortex-m1
  • @platforms//cpu:cortex-m0
  • @platforms//cpu:cortex-m4
  • @platforms//cpu:cortex-m0plus
  • @platforms//cpu:cortex-m7
  • @platforms//cpu:cortex-m23
  • @platforms//cpu:cortex-m33
  • @platforms//cpu:cortex-m35p
  • @platforms//cpu:cortex-m55
  • @platforms//cpu:cortex-m85
  • @platforms//cpu:cortex-m52

And then mark the armv*-m ones as deprecated.

Note that for reasons being discussed in #100, no FPU nuances will be represented in these CPU types.

@armandomontanez
Copy link
Author

I'm debating the value of converting the old variants to alias rules. Some translate trivially: armv7-m->cortex-m3, others less so: armv7e-m->[cortex-m4 or cortex-m7]. Also armv8-m should probably map to Cortex-M33 since M33 is likely what users want when they reference ARMv8-M (since main and base qualifiers were missing). Aliases seem like the right solution if there's ever a desire to eventually remove the old constraints, because otherwise migration is particularly difficult.

If we do aliases, we should probably map it like this:

  • armv6-m -> cortex-m0
  • armv7-m -> cortex-m3
  • armv7e-m -> cortex-m4
  • armv7e-mf -> considered completely deprecated.
  • armv8-m -> cortex-m33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant