3 ms·
:) We (several engineers) put together a table [1] of instructions that several architectures natively support. There was enough overlap that I thought a wrappe
by janwas 4y ago
:) We (several engineers) put together a table [1] of instructions that several architectures natively support.
There was enough overlap that I thought a wrapper would make sense.
With a lot of the JPEG XL code written, when SVE and RVV were being introduced/discussed, I realized that pretty much the same code would work there, too: we just needed to replace a constexpr VecClass::kLanes with Lanes(), which is what Highway now does.
Beyond the initial set of efficient-everywhere ops, we've added some (such as AbsDiff) that help on say Arm without hurting other platforms, nor can user code do better itself. There are also a few (ReorderWidenMulAccumulate) that define a non-obvious relaxation of the interface which is more efficient for all platforms than holding to any one platform's interface.
For RVV, one remaining concern is the VSETVLI - the revised intrinsics now require an avl argument, which Highway creates in each function. It's not yet clear whether the compiler will be smart enough to (peephole-?)optimize away the duplicates.
1: https://github.com/google/highway/blob/master/g3doc/instruction_matrix.pdf https://github.com/google/highway/blob/master/g3doc/instruct...