▲ | __abadams__ 20 hours ago | |||||||
It would be very easy to support 512-bit vectors everywhere, and just emulate them on most systems with a small number of smaller vectors. It's easy for a compiler to generate good code for this. Clang does it well if you use its built-in vector types (which can be any length). Variable-length vectors, on the other hand, are a very challenging problem for compiler devs. You tend to get worse code out than if you just statically picked a size, even if it's not the native size. | ||||||||
▲ | jandrewrogers 20 hours ago | parent | next [-] | |||||||
The risk of 512-bit vectors everywhere is that many algorithms will spill the registers pretty badly if implemented in e.g. 128-bit vectors under the hood. In such cases you may be better off with a completely different algorithm implementation. | ||||||||
▲ | Someone 7 hours ago | parent | prev | next [-] | |||||||
> It would be very easy to support 512-bit vectors everywhere, and just emulate them on most systems with a small number of smaller vectors. It's easy for a compiler to generate good code for this Wouldn’t that be suboptimal if/when CPUs that support 1024-bit vectors come along? > Variable-length vectors, on the other hand, are a very challenging problem for compiler devs. You tend to get worse code out than if you just statically picked a size, even if it's not the native size. Why would it be challenging? You could statically pick a size on a system with variable-length vectors, too. How would that be worse code? | ||||||||
| ||||||||
▲ | codedokode 12 hours ago | parent | prev [-] | |||||||
Variable length vectors seem to be made for closed-source manually-written assembly (nobody wants to unroll the loop manually and nobody will rewrite it for new register width). |