[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 15 01:38:53 PST 2021


fhahn added a comment.

In D113779#3130701 <https://reviews.llvm.org/D113779#3130701>, @SjoerdMeijer wrote:

> This introduces another way of setting (optional) architecture extensions and having two ways to do the same is nearly always a bad thing, which is how one of my colleagues phrased it.

I think there's a subtle difference to using the `-mXXX` options vs `-march`. `-mXXX` adds a feature *without* changing the default architecture version. Unless I am missing something, it's not possible to selectively add target features using `-march` without also forcing the architecture version to some particular version.

AFAICT the only alternative to `-mXXX` options would be using `-Xclang -target-feature -Xclang +dotprod`, which is very verbose and not documented.

The `-mXXX` flags would allow users to conveniently write forward-compatible compiler invocations that also ensure a minimum set of features is available. Using `-mXXX` flags is very common on X86 and providing a similar interface for AArch64 will likely help users transitioning.

> - how do these new `-m` flags and `-march` interact?

The `-mXXX` flags add the target feature to the list of target features, the same as additional features provided to `-march`. It should be equivalent to specifying extra flags via `-march` in terms of checking for invalid combinations and conflict resolution.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113779/new/

https://reviews.llvm.org/D113779



More information about the cfe-commits mailing list