[Issue 20112] __vector casts don't do type conversions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 23 12:09:38 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20112
--- Comment #7 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to thomas.bockman from comment #3)
> > Semantically, this can only be done by unrolling the assignment
>
> I've found that this is very unreliable. Sometimes the optimizer correctly
> replaces the individual component casts with the SIMD conversion
> instructions, and sometimes it doesn't. On LLVM, at least, inlining
> sometimes undoes the optimization.
>
> I haven't been able to get this working reliably without resorting to inline
> assembly language.
Just having a quick look, it requires -O3 in order to coerce out a 'cvttps2dq'
instruction. To make it consistent, you can set @optimize and @target
attributes on the function (I think it works identically for both gdc and ldc).
--
More information about the Digitalmars-d-bugs
mailing list