6 ms·
It is probably faster, yes (half the number of reads) – but the point of this truck is that you can re-use the (hopefully) vectorized memcmp on every platform w
by BeeOnRope 5y ago
It is probably faster, yes (half the number of reads) – but the point of this truck is that you can re-use the (hopefully) vectorized memcmp on every platform with portable code rather than getting on the SIMD ISA treadmill yourself.
- rwmj 5y agoThe qemu implementation does indeed do it the hard way. It's a lot of code: https://gitlab.com/qemu-project/qemu/-/blob/master/util/bufferiszero.c https://gitlab.com/qemu-project/qemu/-/blob/master/util/buff...
- pm215 5y agoInterestingly, we used to have a special-case aarch64 version, but we dropped it because the C version was faster: https://gitlab.com/qemu-project/qemu/-/commit/2250d3a293d36ed9d8143d4c3d3e94086c429af4 https://gitlab.com/qemu-project/qemu/-/commit/2250d3a293d36e... (Might or might not still be true on more modern aarch64 hardware...)
- pm215 5y agoDoes your memset version beat QEMU's plain-old-C fallback version ?