Skip to content

[ci] fix formatting and clippy #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ mod v256;
mod v512;
mod v64;

/// 32-bit wide vector tpyes
mod v32 {
use simd_llvm::*;

Expand All @@ -172,21 +173,17 @@ mod v32 {
define_ty! { i8x4, i8, i8, i8, i8 }
define_impl! { i8x4, i8, 4, i8x4, x0, x1, x2, x3 }

define_casts!(
(i8x4, i32x4, as_i32x4),
(i16x2, i64x2, as_i64x2)
);
define_casts!((i8x4, i32x4, as_i32x4), (i16x2, i64x2, as_i64x2));
}

/// 16-bit wide vector tpyes
mod v16 {
use simd_llvm::*;

define_ty! { i8x2, i8, i8 }
define_impl! { i8x2, i8, 2, i8x2, x0, x1 }

define_casts!(
(i8x2, i64x2, as_i64x2)
);
define_casts!((i8x2, i64x2, as_i64x2));
}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
Expand Down
8 changes: 6 additions & 2 deletions src/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,9 @@ pub unsafe fn _mm_cvtsd_si64(a: f64x2) -> i64 {
#[inline(always)]
#[target_feature = "+sse2"]
#[cfg_attr(test, assert_instr(cvtsd2si))]
pub unsafe fn _mm_cvtsd_si64x(a: f64x2) -> i64 { _mm_cvtsd_si64(a) }
pub unsafe fn _mm_cvtsd_si64x(a: f64x2) -> i64 {
_mm_cvtsd_si64(a)
}

/// Convert the lower double-precision (64-bit) floating-point element in `b`
/// to a single-precision (32-bit) floating-point element, store the result in
Expand Down Expand Up @@ -1857,7 +1859,9 @@ pub unsafe fn _mm_cvttsd_si64(a: f64x2) -> i64 {
#[inline(always)]
#[target_feature = "+sse2"]
#[cfg_attr(test, assert_instr(cvttsd2si))]
pub unsafe fn _mm_cvttsd_si64x(a: f64x2) -> i64 { _mm_cvttsd_si64(a) }
pub unsafe fn _mm_cvttsd_si64x(a: f64x2) -> i64 {
_mm_cvttsd_si64(a)
}

/// Convert packed single-precision (32-bit) floating-point elements in `a` to
/// packed 32-bit integers with truncation.
Expand Down
12 changes: 7 additions & 5 deletions src/x86/sse41.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ pub unsafe fn _mm_max_epu32(a: u32x4, b: u32x4) -> u32x4 {
pmaxud(a, b)
}

/// Convert packed 32-bit integers from `a` and `b` to packed 16-bit integers using unsigned saturation
/// Convert packed 32-bit integers from `a` and `b` to packed 16-bit integers
/// using unsigned saturation
#[inline(always)]
#[target_feature = "+sse4.1"]
#[cfg_attr(test, assert_instr(packusdw))]
Expand Down Expand Up @@ -276,7 +277,8 @@ pub unsafe fn _mm_cvtepi8_epi32(a: i8x16) -> i32x4 {
simd_shuffle4::<_, ::v32::i8x4>(a, a, [0, 1, 2, 3]).as_i32x4()
}

/// Sign extend packed 8-bit integers in the low 8 bytes of `a` to packed 64-bit integers
/// Sign extend packed 8-bit integers in the low 8 bytes of `a` to packed
/// 64-bit integers
#[inline(always)]
#[target_feature = "+sse4.1"]
#[cfg_attr(test, assert_instr(pmovsxbq))]
Expand Down Expand Up @@ -800,7 +802,7 @@ mod tests {
assert_eq!(r, e);
}

#[simd_test = "sse4.1"]
#[simd_test = "sse4.1"]
unsafe fn _mm_cvtepi8_epi16() {
let a = i8x16::splat(10);
let r = sse41::_mm_cvtepi8_epi16(a);
Expand Down Expand Up @@ -842,7 +844,7 @@ mod tests {
let r = sse41::_mm_cvtepi16_epi32(a);
let e = i32x4::splat(10);
assert_eq!(r, e);
let a = i16x8::splat(-10);
let a = i16x8::splat(-10);
let r = sse41::_mm_cvtepi16_epi32(a);
let e = i32x4::splat(-10);
assert_eq!(r, e);
Expand All @@ -854,7 +856,7 @@ mod tests {
let r = sse41::_mm_cvtepi16_epi64(a);
let e = i64x2::splat(10);
assert_eq!(r, e);
let a = i16x8::splat(-10);
let a = i16x8::splat(-10);
let r = sse41::_mm_cvtepi16_epi64(a);
let e = i64x2::splat(-10);
assert_eq!(r, e);
Expand Down