Debian Codegraph @

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

raw
1 #![cfg(target_feature = "adx")]
2
3 use super::*;
4
5 /// Add two `u32` with a carry value.
6 ///
7 /// Writes the sum to the reference, and returns the new carry flag.
8 ///
9 /// * **Intrinsic:** [`_addcarryx_u32`]
10 /// * **Assembly:**
11 /// ```asm
12 /// adcx r32, r32
13 /// adox r32, r32
14 /// ```
15 #[inline(always)]
16 #[cfg_attr(docsrs, doc(cfg(target_feature = "adx")))]
17 pub fn add_carry_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
18 unsafe { _addcarryx_u32(c_in, a, b, out) }
19 }
20
21 /// Add two `u64` with a carry value.
22 ///
23 /// Writes the sum to the reference and returns the new carry flag.
24 ///
25 /// * **Intrinsic:** [`_addcarryx_u64`]
26 /// * **Assembly:**
27 /// ```asm
28 /// adcx r64, r64
29 /// adox r64, r64
30 /// ```
31 #[inline(always)]
32 #[cfg_attr(docsrs, doc(cfg(target_feature = "adx")))]
33 #[cfg(target_arch = "x86_64")]
34 pub fn add_carry_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
35 unsafe { _addcarryx_u64(c_in, a, b, out) }
36 }