From 46c6e9beb6dccbcdebe66334f24d416748c46b83 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sat, 28 Oct 2017 22:29:52 +0200 Subject: [PATCH] [fmt] use cargo fmt --all (#161) --- library/stdarch/.travis.yml | 8 +------- library/stdarch/src/x86/avx2.rs | 19 ++++++++++++++----- library/stdarch/stdsimd-test/src/lib.rs | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/library/stdarch/.travis.yml b/library/stdarch/.travis.yml index ed8cbdae308d..c7a7bbc4693d 100644 --- a/library/stdarch/.travis.yml +++ b/library/stdarch/.travis.yml @@ -20,13 +20,7 @@ matrix: - env: RUSTFMT=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1 script: | cargo install rustfmt-nightly - cargo fmt -- --write-mode=diff - cd stdsimd - cargo fmt -- --write-mode=diff - cd assert-instr-macro - cargo fmt -- --write-mode=diff - cd ../simd-test-macro - cargo fmt -- --write-mode=diff + cargo fmt --all -- --write-mode=diff allow_failures: - env: RUSTFMT=On TARGET=x86_64-unknown-linux-gnu NO_ADD=1 diff --git a/library/stdarch/src/x86/avx2.rs b/library/stdarch/src/x86/avx2.rs index edbf72064329..d8671b3f5772 100644 --- a/library/stdarch/src/x86/avx2.rs +++ b/library/stdarch/src/x86/avx2.rs @@ -755,7 +755,9 @@ pub unsafe fn _mm_maskload_epi32(mem_addr: *const i32, mask: i32x4) -> i32x4 { #[inline(always)] #[target_feature = "+avx2"] #[cfg_attr(test, assert_instr(vpmaskmovd))] -pub unsafe fn _mm256_maskload_epi32(mem_addr: *const i32, mask: i32x8) -> i32x8 { +pub unsafe fn _mm256_maskload_epi32( + mem_addr: *const i32, mask: i32x8 +) -> i32x8 { maskloadd256(mem_addr as *const i8, mask) } @@ -775,7 +777,9 @@ pub unsafe fn _mm_maskload_epi64(mem_addr: *const i64, mask: i64x2) -> i64x2 { #[inline(always)] #[target_feature = "+avx2"] #[cfg_attr(test, assert_instr(vpmaskmovq))] -pub unsafe fn _mm256_maskload_epi64(mem_addr: *const i64, mask: i64x4) -> i64x4 { +pub unsafe fn _mm256_maskload_epi64( + mem_addr: *const i64, mask: i64x4 +) -> i64x4 { maskloadq256(mem_addr as *const i8, mask) } @@ -795,7 +799,9 @@ pub unsafe fn _mm_maskstore_epi32(mem_addr: *mut i32, mask: i32x4, a: i32x4) { #[inline(always)] #[target_feature = "+avx2"] #[cfg_attr(test, assert_instr(vpmaskmovd))] -pub unsafe fn _mm256_maskstore_epi32(mem_addr: *mut i32, mask: i32x8, a: i32x8) { +pub unsafe fn _mm256_maskstore_epi32( + mem_addr: *mut i32, mask: i32x8, a: i32x8 +) { maskstored256(mem_addr as *mut i8, mask, a) } @@ -815,7 +821,9 @@ pub unsafe fn _mm_maskstore_epi64(mem_addr: *mut i64, mask: i64x2, a: i64x2) { #[inline(always)] #[target_feature = "+avx2"] #[cfg_attr(test, assert_instr(vpmaskmovq))] -pub unsafe fn _mm256_maskstore_epi64(mem_addr: *mut i64, mask: i64x4, a: i64x4) { +pub unsafe fn _mm256_maskstore_epi64( + mem_addr: *mut i64, mask: i64x4, a: i64x4 +) { maskstoreq256(mem_addr as *mut i8, mask, a) } @@ -1184,7 +1192,8 @@ pub unsafe fn _mm256_shuffle_epi8(a: u8x32, b: u8x32) -> u8x32 { pshufb(a, b) } -/// Shuffle 32-bit integers in 128-bit lanes of `a` using the control in `imm8`. +/// Shuffle 32-bit integers in 128-bit lanes of `a` using the control in +/// `imm8`. /// /// ```rust /// # #![feature(cfg_target_feature)] diff --git a/library/stdarch/stdsimd-test/src/lib.rs b/library/stdarch/stdsimd-test/src/lib.rs index 5de401695f61..ce52ea5d27e0 100644 --- a/library/stdarch/stdsimd-test/src/lib.rs +++ b/library/stdarch/stdsimd-test/src/lib.rs @@ -326,7 +326,7 @@ pub fn assert(fnptr: usize, fnname: &str, expected: &str) { pub fn assert_skip_test_ok(name: &str) { if env::var("STDSIMD_TEST_EVERYTHING").is_err() { - return + return; } panic!("skipped test `{}` when it shouldn't be skipped", name); }