[Libre-soc-dev] Rust's SIMD project group

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Sep 30 11:15:01 BST 2020


On Wed, Sep 30, 2020 at 9:53 AM Jacob Lifshay <programmerjake at gmail.com> wrote:

> https://zulip-archive.rust-lang.org/257879projectportablesimd/96123LibreSOCsSimpleV.html

okaaay nooow i can reply :)  (and i'll investigate an account later today)

although it is... how do we say... "inevitable" that, as it matures, a
given language would expose SIMD up to developers (gcc intrinsics) the
consequences are... always going to be harmful to those developers
https://www.sigarch.org/simd-instructions-considered-harmful/

a recent implementation of strncpy in PowerISA VSX was a whopping 250
hand-coded assembly instructions yet SV and RVV it is around 14.
https://sourceware.org/pipermail/libc-alpha/2020-September/117429.html

note that, just as outlined in the sigarch article, preparation takes
vast swathes of detection for whether it's "ok" to actually proceed at
all with the 16-byte-wide vector copy, followed by further vast
swathes of "cleanup" cascade-detecting the 8, 4 2 and final 1 bytes
remaining that cannot be copied by a 16-byte-wide vector ISA.

the fact remains - sadly - that despite this god-awful mess - repeated
unavoidably *everywhere* that SIMD is attempted to be used for
general-purpose code - there's actually nothing that rust-lang can do
about it, at a *language* level.  SIMD exists, therefore it needs to
be supported by the language.  going into that eyes-open however will
help avoid some of the... debates.

sadly, if predication was available on SIMD as the "norm" this would
be a different matter entirely.

l.



More information about the Libre-soc-dev mailing list