auto vectorization observations

user1234 user1234 at 12.de
Thu Jun 9 23:35:11 UTC 2022


On Thursday, 9 June 2022 at 20:32:44 UTC, Bruce Carneal wrote:
> On Thursday, 9 June 2022 at 14:28:31 UTC, Siarhei Siamashka 
> wrote:
>> On Wednesday, 8 June 2022 at 18:41:44 UTC, Bruce Carneal wrote:
>>> As an example, gdc is able to vectorize the following for 
>>> both ARM SVE and x86-SIMD architectures while ldc, per my 
>>> godbolt testing at least, can not.
>>
>> I was unable to confirm this: 
>> https://d.godbolt.org/z/Y9fEvn83e (neither GDC nor LDC can 
>> vectorize it). Could you please post a link to your godbolt 
>> results with the right compiler versions and optimization 
>> options?
>
> https://godbolt.org/z/1exqWT49c
>
> The above is a link to gdc/ldc godbolt comparison with 
> x86-64-v4 targets. I'm not sure which subset of the v4 
> capabilities are required for gdc to vectorize the code.  It 
> does not vectorize v3, so *very* recent x86s in any event.

Thanks for the precision, I wondered the same as Siarhei.
gdc options "-O3 -mavx512bw" produceq the same output as your.
With no surprise LDC does not do better with -mattr=+avx512bw.




More information about the Digitalmars-d mailing list