AVX for math code ... avx instructions later disappearing ?
kinke
noone at nowhere.com
Sun Sep 26 19:00:54 UTC 2021
On Sunday, 26 September 2021 at 18:08:46 UTC, james.p.leblanc
wrote:
> or even moving the array declarations to before
> the dot product function, and the avx instructions will
> disappear!
That's because the `@fastmath` UDA applies to the next
declaration only, which is the `x` array in your 2nd example
(where it obviously has no effect). Either use `@fastmath:` with
the colon to apply it to the entire scope, or use `-ffast-math`
in the LDC cmdline.
Similarly, when moving the function to another module and you
don't include that module in the cmdline, it's only imported and
not compiled and won't show up in the resulting assembly.
Wrt. stack alignment, there aren't any issues with LDC AFAIK (not
limited to 16 or whatever like DMD).
More information about the Digitalmars-d-learn
mailing list