Skip to content

Commit

Permalink
acle: move arm/dsp into acle/{dsp,simd32}
Browse files Browse the repository at this point in the history
addresses #557 (comment)
  • Loading branch information
japaric authored and gnzlbg committed Feb 18, 2019
1 parent bd71133 commit fa2fcef
Show file tree
Hide file tree
Showing 4 changed files with 720 additions and 729 deletions.
57 changes: 42 additions & 15 deletions crates/core_arch/src/acle/dsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,45 @@
//!
//! Intrinsics that could live here:
//!
//! - __smulbb
//! - __smulbt
//! - __smultb
//! - __smultt
//! - __smulwb
//! - __smulwt
//! - __qadd
//! - __qsub
//! - __qdbl
//! - __smlabb
//! - __smlabt
//! - __smlatb
//! - __smlatt
//! - __smlawb
//! - __smlawt
//! - [ ] __smulbb
//! - [ ] __smulbt
//! - [ ] __smultb
//! - [ ] __smultt
//! - [ ] __smulwb
//! - [ ] __smulwt
//! - [x] __qadd
//! - [x] __qsub
//! - [ ] __qdbl
//! - [ ] __smlabb
//! - [ ] __smlabt
//! - [ ] __smlatb
//! - [ ] __smlatt
//! - [ ] __smlawb
//! - [ ] __smlawt

extern "C" {
#[link_name = "llvm.arm.qadd"]
fn arm_qadd(a: i32, b: i32) -> i32;

#[link_name = "llvm.arm.qsub"]
fn arm_qsub(a: i32, b: i32) -> i32;

}

/// Signed saturating addition
///
/// Returns the 32-bit saturating signed equivalent of a + b.
#[inline]
#[cfg_attr(test, assert_instr(qadd))]
pub unsafe fn qadd(a: i32, b: i32) -> i32 {
arm_qadd(a, b)
}

/// Signed saturating subtraction
///
/// Returns the 32-bit saturating signed equivalent of a - b.
#[inline]
#[cfg_attr(test, assert_instr(qsub))]
pub unsafe fn qsub(a: i32, b: i32) -> i32 {
arm_qsub(a, b)
}
Loading

0 comments on commit fa2fcef

Please sign in to comment.