Debian Codegraph @

debian/missing-sources/safe_arch/src/x86_x64/pclmulqdq.rs

raw
1 #![cfg(target_feature = "pclmulqdq")]
2
3 use super::*;
4
5 /// Performs a "carryless" multiplication of two `i64` values.
6 ///
7 /// The `IMM` value selects which lanes of `a` and `b` are multiplied.
8 /// * Bit 0: the `i64` index from `a` to multiply.
9 /// * Bit 4: the `i64` index from `b` to multiply.
10 ///
11 /// The output is always in the low `i64` lane, with the high lane as 0.
12 ///
13 /// * **Intrinsic:** [`_mm_clmulepi64_si128`]
14 /// * **Assembly:** `pclmulqdq xmm, xmm, imm8`
15 #[must_use]
16 #[inline(always)]
17 #[cfg_attr(docsrs, doc(cfg(target_feature = "pclmulqdq")))]
18 pub fn mul_i64_carryless_m128i<const IMM: i32>(a: m128i, b: m128i) -> m128i {
19 m128i(unsafe { _mm_clmulepi64_si128(a.0, b.0, IMM) })
20 }
21