archspec / archspec-json

Other
20 stars 33 forks source link

Add Clang optimization flags for Apple M1 #43

Closed giordano closed 2 years ago

giordano commented 2 years ago

Vanilla Clang supports tuning for apple-m1 target since version 13: https://github.com/llvm/llvm-project/commit/a8a3a43792472c9775c60fa79b9357033d47ce40. Also Apple Clang 13 supports the apple-m1 target.

I think this may fix #42. CC: @trws

Side note: I'm not touching GCC, but I'm not sure it makes much sense, especially starting from version 8, since no stable version of GCC can target that platform. https://github.com/iains/gcc-darwin-arm64 is the only fork of GCC I know which can compile for this platform, at https://github.com/iains/gcc-darwin-arm64/issues/86#issuecomment-1089406128 there is a possible value of -march (but at the moment it doesn't do any further optimisation, no support for specific -mcpu).

giordano commented 2 years ago

I pushed a commit to keep only -mcpu=apple-m1 where available, to address comments in #42. However, I think GitHub is having troubles, right now so the commit hasn't showed up here yet.