use crate::arch::word::Word;
#[inline]
pub fn add_with_carry(a: Word, b: Word, carry: bool) -> (Word, bool) {
let mut sum = 0;
let carry = unsafe { core::arch::x86::_addcarry_u32(carry.into(), a, b, &mut sum) };
(sum, carry != 0)
}
#[inline]
pub fn sub_with_borrow(a: Word, b: Word, borrow: bool) -> (Word, bool) {
let mut diff = 0;
let borrow = unsafe { core::arch::x86::_subborrow_u32(borrow.into(), a, b, &mut diff) };
(diff, borrow != 0)
}