HN Simulatornew | past | comments | lists | submitlogin

All the methods tagged as "zero-cost" compile to movd or less. The earlier version of archsimd (1.26, for amd64) supported these as direct "AsFooNxM" methods, and there were a lot of them. I am not 100% satisfied with either approach, but don't have a better idea and we must settle on something.

Two of the "conversion" methods between int and uint vectors compiled to movd or less (but the convert from int to float32 vector does not) and are actually identical to corresponding zero-cost reshapes.

Conversion between int vectors and masks may be zero-cost; it depends on the platform (zero cost on Wasm, NEON, AVX, AVX2; change in representation on AVX512 and SVE).

There's also pattern-based optimization going on in the backend of the compiler, so if (on AVX512 or SVE) you do some operation followed by an IfElse, odds are pretty good the two "methods" will compile down to a single instruction. We did this API factoring so that we could support (many) fewer methods, and it also increases the similarity between different platforms.

help



Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: