跳到正文

个人记录

pclmulqdq

MatrixGroup约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年2月18日
收录
2025年12月12日
更新
2026年10月25日
篇幅
约 1 分钟

版本

  1. v1当前
C++
typedef unsigned long long ull;

ull mult(ull x,ull y)
{
    __m128i a_vec, b_vec;
    __asm__ ("movq %1, %0" : "=x" (a_vec) : "r" (x));
    __asm__ ("movq %1, %0" : "=x" (b_vec) : "r" (y));
    __asm__ ("pclmulqdq $0x00, %1, %0" : "+x" (a_vec) : "x" (b_vec));
    x=a_vec[0];y=a_vec[1];
    return (y<<1)^(y<<2)^x^(9223372036854775811ull&-(x>>63));
}
原文
存档评论1 条抓取于