News for hackers. Stuff that matters.
Re:Memory access on the Apple M1 processor by namibj on Wednesday January 06, 2021 @04:53PM (#25663106)
You _need_ to use -mnative because it otherwise retains backwards compatibility to older x86.
Re:Memory access on the Apple M1 processor by FabHK on Wednesday January 06, 2021 @06:00PM (#25663901)

  (base) Coding % cc -mnative two-three.c
  clang: error: unknown argument: '-mnative'

  (base) Coding % cc -v
  Apple clang version 12.0.0 (clang-1200.0.32.28)
  Target: x86_64-apple-darwin20.2.0
  Thread model: posix
Re:Memory access on the Apple M1 processor by astrange on Wednesday January 06, 2021 @09:23PM (#25666500)
It's spelled "-march=native" in gcc and "-arch x86_64h" in clang.

It doesn't make much difference though, autovectorization doesn't work very well and there is not a lot of special optimization for newer x86 CPUs.

Re:Memory access on the Apple M1 processor by namibj on Thursday January 07, 2021 @10:05PM (#25681042)
All recent Intel Core-i microarchitectures require using full vector width loads to max out L1d bandwidth, because the load/store units don't actually care about the width of a load, as long as it doesn't cross a cache line (in which case the typical penalty is an additional cycle).

Only using 128 bit wide instructions on a core that has 512 bit hardware results in 4x less L1d bandwidth.