x86 VP2INTERSECT指令的比本机更快的替代方案
Faster-Than-Native Alternatives for x86 VP2INTERSECT Instructions
摘要:
我们提出了比本机更快的替代完整的AVX 512-VP 2 INTERSECT指令子集使用基本AVX 512 F指令。这些替代方案仅计算输出掩码中的一个,这对于计算两个整数的排序列表的交集或计算这样的交集的大小的典型情况是足够的。虽然朴素的实现(将第一个输入向量与第二个输入向量的所有旋转进行比较)比本机指令慢,但我们表明,通过同时旋转第一个和第二个操作数,可以显著节省向量旋转的总数,从而使仿真比本机指令快,适用于VP 2 INTERSECT子集中的所有指令。此外,仿真可以很容易地扩展到其他类型的输入(例如,16位整数的打包向量),对于这些输入,本地指令不可用。
英文摘要:
We present faster-than-native alternatives for the full AVX512-VP2INTERSECT instruction subset using basic AVX512F instructions. These alternatives compute only one of the output masks, which is sufficient for the typical case of computing the intersection of two sorted lists of integers, or computing the size of such an intersection. While the naïve implementation (compare the first input vector against all rotations of the second) is slower than the native instructions, we show that by rotating both the first and second operands at the same time there is a significant saving in the total number of vector rotations, resulting in the emulations being faster than the native instructions, for all instructions in the VP2INTERSECT subset. Additionally, the emulations can be easily extended to other types of inputs (e.g. packed vectors of 16-bit integers) for which native instructions are not available.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。