Skip to content

Commit dfb414e

Browse files
RalfJungAmanieu
authored andcommitted
addcarryx: use pointers of the right type
1 parent 88c3d88 commit dfb414e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/core_arch/src/x86/adx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ extern "unadjusted" {
66
#[link_name = "llvm.x86.addcarry.32"]
77
fn llvm_addcarry_u32(a: u8, b: u32, c: u32) -> (u8, u32);
88
#[link_name = "llvm.x86.addcarryx.u32"]
9-
fn llvm_addcarryx_u32(a: u8, b: u32, c: u32, d: *mut u8) -> u8;
9+
fn llvm_addcarryx_u32(a: u8, b: u32, c: u32, d: *mut u32) -> u8;
1010
#[link_name = "llvm.x86.subborrow.32"]
1111
fn llvm_subborrow_u32(a: u8, b: u32, c: u32) -> (u8, u32);
1212
}
1313

1414
/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
15-
/// (carry flag), and store the unsigned 32-bit result in `out`, and the carry-out
15+
/// (carry or overflow flag), and store the unsigned 32-bit result in `out`, and the carry-out
1616
/// is returned (carry or overflow flag).
1717
#[inline]
1818
#[cfg_attr(test, assert_instr(adc))]
@@ -31,7 +31,7 @@ pub unsafe fn _addcarry_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
3131
#[cfg_attr(test, assert_instr(adc))]
3232
#[stable(feature = "simd_x86_adx", since = "1.33.0")]
3333
pub unsafe fn _addcarryx_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
34-
llvm_addcarryx_u32(c_in, a, b, out as *mut _ as *mut u8)
34+
llvm_addcarryx_u32(c_in, a, b, out as *mut _)
3535
}
3636

3737
/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`

crates/core_arch/src/x86_64/adx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ extern "unadjusted" {
66
#[link_name = "llvm.x86.addcarry.64"]
77
fn llvm_addcarry_u64(a: u8, b: u64, c: u64) -> (u8, u64);
88
#[link_name = "llvm.x86.addcarryx.u64"]
9-
fn llvm_addcarryx_u64(a: u8, b: u64, c: u64, d: *mut u8) -> u8;
9+
fn llvm_addcarryx_u64(a: u8, b: u64, c: u64, d: *mut u64) -> u8;
1010
#[link_name = "llvm.x86.subborrow.64"]
1111
fn llvm_subborrow_u64(a: u8, b: u64, c: u64) -> (u8, u64);
1212
}
1313

1414
/// Adds unsigned 64-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`
15-
/// (carry flag), and store the unsigned 64-bit result in `out`, and the carry-out
15+
/// (carry or overflow flag), and store the unsigned 64-bit result in `out`, and the carry-out
1616
/// is returned (carry or overflow flag).
1717
#[inline]
1818
#[cfg_attr(test, assert_instr(adc))]
@@ -31,7 +31,7 @@ pub unsafe fn _addcarry_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
3131
#[cfg_attr(test, assert_instr(adc))]
3232
#[stable(feature = "simd_x86_adx", since = "1.33.0")]
3333
pub unsafe fn _addcarryx_u64(c_in: u8, a: u64, b: u64, out: &mut u64) -> u8 {
34-
llvm_addcarryx_u64(c_in, a, b, out as *mut _ as *mut u8)
34+
llvm_addcarryx_u64(c_in, a, b, out as *mut _)
3535
}
3636

3737
/// Adds unsigned 64-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`.

0 commit comments

Comments
 (0)