Skip to content

Commit 7082e95

Browse files
gnzlbgalexcrichton
authored andcommitted
re-format (#544)
1 parent 696e957 commit 7082e95

File tree

19 files changed

+745
-524
lines changed

19 files changed

+745
-524
lines changed

coresimd/aarch64/crypto.rs

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,12 @@ mod tests {
191191

192192
#[simd_test(enable = "crypto")]
193193
unsafe fn test_vaeseq_u8() {
194-
let data = ::mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
195-
let key = ::mem::transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
194+
let data = ::mem::transmute(u8x16::new(
195+
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
196+
));
197+
let key = ::mem::transmute(u8x16::new(
198+
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
199+
));
196200
let r: u8x16 = ::mem::transmute(vaeseq_u8(data, key));
197201
assert_eq!(
198202
r,
@@ -205,8 +209,12 @@ mod tests {
205209

206210
#[simd_test(enable = "crypto")]
207211
unsafe fn test_vaesdq_u8() {
208-
let data = ::mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
209-
let key = ::mem::transmute(u8x16::new(0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7));
212+
let data = ::mem::transmute(u8x16::new(
213+
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
214+
));
215+
let key = ::mem::transmute(u8x16::new(
216+
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
217+
));
210218
let r: u8x16 = ::mem::transmute(vaesdq_u8(data, key));
211219
assert_eq!(
212220
r,
@@ -218,7 +226,9 @@ mod tests {
218226

219227
#[simd_test(enable = "crypto")]
220228
unsafe fn test_vaesmcq_u8() {
221-
let data = ::mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
229+
let data = ::mem::transmute(u8x16::new(
230+
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
231+
));
222232
let r: u8x16 = ::mem::transmute(vaesmcq_u8(data));
223233
assert_eq!(
224234
r,
@@ -228,7 +238,9 @@ mod tests {
228238

229239
#[simd_test(enable = "crypto")]
230240
unsafe fn test_vaesimcq_u8() {
231-
let data = ::mem::transmute(u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8));
241+
let data = ::mem::transmute(u8x16::new(
242+
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8,
243+
));
232244
let r: u8x16 = ::mem::transmute(vaesimcq_u8(data));
233245
assert_eq!(
234246
r,
@@ -248,9 +260,15 @@ mod tests {
248260
#[simd_test(enable = "crypto")]
249261
unsafe fn test_vsha1su0q_u32() {
250262
let r: u32x4 = ::mem::transmute(vsha1su0q_u32(
251-
::mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
252-
::mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
253-
::mem::transmute(u32x4::new(0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32)),
263+
::mem::transmute(u32x4::new(
264+
0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32,
265+
)),
266+
::mem::transmute(u32x4::new(
267+
0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32,
268+
)),
269+
::mem::transmute(u32x4::new(
270+
0x1234_u32, 0x5678_u32, 0x9abc_u32, 0xdef0_u32,
271+
)),
254272
));
255273
assert_eq!(r, u32x4::new(0x9abc, 0xdef0, 0x1234, 0x5678));
256274
}

coresimd/aarch64/neon.rs

Lines changed: 76 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,10 @@ mod tests {
539539
let a = f64x2::new(1., 2.);
540540
let b = f64x2::new(8., 7.);
541541
let e = f64x2::new(9., 9.);
542-
let r: f64x2 = ::mem::transmute(vaddq_f64(::mem::transmute(a), ::mem::transmute(b)));
542+
let r: f64x2 = ::mem::transmute(vaddq_f64(
543+
::mem::transmute(a),
544+
::mem::transmute(b),
545+
));
543546
assert_eq!(r, e);
544547
}
545548

@@ -589,7 +592,8 @@ mod tests {
589592

590593
#[simd_test(enable = "neon")]
591594
unsafe fn test_vmaxvq_s16() {
592-
let r = vmaxvq_s16(::mem::transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
595+
let r =
596+
vmaxvq_s16(::mem::transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
593597
assert_eq!(r, 7_i16);
594598
}
595599

@@ -631,7 +635,8 @@ mod tests {
631635

632636
#[simd_test(enable = "neon")]
633637
unsafe fn test_vmaxvq_u16() {
634-
let r = vmaxvq_u16(::mem::transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
638+
let r =
639+
vmaxvq_u16(::mem::transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
635640
assert_eq!(r, 16_u16);
636641
}
637642

@@ -691,7 +696,8 @@ mod tests {
691696

692697
#[simd_test(enable = "neon")]
693698
unsafe fn test_vminvq_s16() {
694-
let r = vminvq_s16(::mem::transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
699+
let r =
700+
vminvq_s16(::mem::transmute(i16x8::new(1, 2, 7, 4, -16, 6, 7, 5)));
695701
assert_eq!(r, -16_i16);
696702
}
697703

@@ -733,7 +739,8 @@ mod tests {
733739

734740
#[simd_test(enable = "neon")]
735741
unsafe fn test_vminvq_u16() {
736-
let r = vminvq_u16(::mem::transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
742+
let r =
743+
vminvq_u16(::mem::transmute(u16x8::new(1, 2, 7, 4, 16, 6, 7, 5)));
737744
assert_eq!(r, 1_u16);
738745
}
739746

@@ -775,7 +782,10 @@ mod tests {
775782
let b = i8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
776783
#[cfg_attr(rustfmt, skip)]
777784
let e = i8x16::new(-2, -4, 5, 7, 1, 3, 5, 7, 0, 2, 4, 6, 0, 2, 4, 6);
778-
let r: i8x16 = ::mem::transmute(vpminq_s8(::mem::transmute(a), ::mem::transmute(b)));
785+
let r: i8x16 = ::mem::transmute(vpminq_s8(
786+
::mem::transmute(a),
787+
::mem::transmute(b),
788+
));
779789
assert_eq!(r, e);
780790
}
781791

@@ -784,7 +794,10 @@ mod tests {
784794
let a = i16x8::new(1, -2, 3, 4, 5, 6, 7, 8);
785795
let b = i16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
786796
let e = i16x8::new(-2, 3, 5, 7, 0, 2, 4, 6);
787-
let r: i16x8 = ::mem::transmute(vpminq_s16(::mem::transmute(a), ::mem::transmute(b)));
797+
let r: i16x8 = ::mem::transmute(vpminq_s16(
798+
::mem::transmute(a),
799+
::mem::transmute(b),
800+
));
788801
assert_eq!(r, e);
789802
}
790803

@@ -793,7 +806,10 @@ mod tests {
793806
let a = i32x4::new(1, -2, 3, 4);
794807
let b = i32x4::new(0, 3, 2, 5);
795808
let e = i32x4::new(-2, 3, 0, 2);
796-
let r: i32x4 = ::mem::transmute(vpminq_s32(::mem::transmute(a), ::mem::transmute(b)));
809+
let r: i32x4 = ::mem::transmute(vpminq_s32(
810+
::mem::transmute(a),
811+
::mem::transmute(b),
812+
));
797813
assert_eq!(r, e);
798814
}
799815

@@ -805,7 +821,10 @@ mod tests {
805821
let b = u8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
806822
#[cfg_attr(rustfmt, skip)]
807823
let e = u8x16::new(1, 3, 5, 7, 1, 3, 5, 7, 0, 2, 4, 6, 0, 2, 4, 6);
808-
let r: u8x16 = ::mem::transmute(vpminq_u8(::mem::transmute(a), ::mem::transmute(b)));
824+
let r: u8x16 = ::mem::transmute(vpminq_u8(
825+
::mem::transmute(a),
826+
::mem::transmute(b),
827+
));
809828
assert_eq!(r, e);
810829
}
811830

@@ -814,7 +833,10 @@ mod tests {
814833
let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
815834
let b = u16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
816835
let e = u16x8::new(1, 3, 5, 7, 0, 2, 4, 6);
817-
let r: u16x8 = ::mem::transmute(vpminq_u16(::mem::transmute(a), ::mem::transmute(b)));
836+
let r: u16x8 = ::mem::transmute(vpminq_u16(
837+
::mem::transmute(a),
838+
::mem::transmute(b),
839+
));
818840
assert_eq!(r, e);
819841
}
820842

@@ -823,7 +845,10 @@ mod tests {
823845
let a = u32x4::new(1, 2, 3, 4);
824846
let b = u32x4::new(0, 3, 2, 5);
825847
let e = u32x4::new(1, 3, 0, 2);
826-
let r: u32x4 = ::mem::transmute(vpminq_u32(::mem::transmute(a), ::mem::transmute(b)));
848+
let r: u32x4 = ::mem::transmute(vpminq_u32(
849+
::mem::transmute(a),
850+
::mem::transmute(b),
851+
));
827852
assert_eq!(r, e);
828853
}
829854

@@ -832,7 +857,10 @@ mod tests {
832857
let a = f32x4::new(1., -2., 3., 4.);
833858
let b = f32x4::new(0., 3., 2., 5.);
834859
let e = f32x4::new(-2., 3., 0., 2.);
835-
let r: f32x4 = ::mem::transmute(vpminq_f32(::mem::transmute(a), ::mem::transmute(b)));
860+
let r: f32x4 = ::mem::transmute(vpminq_f32(
861+
::mem::transmute(a),
862+
::mem::transmute(b),
863+
));
836864
assert_eq!(r, e);
837865
}
838866

@@ -841,7 +869,10 @@ mod tests {
841869
let a = f64x2::new(1., -2.);
842870
let b = f64x2::new(0., 3.);
843871
let e = f64x2::new(-2., 0.);
844-
let r: f64x2 = ::mem::transmute(vpminq_f64(::mem::transmute(a), ::mem::transmute(b)));
872+
let r: f64x2 = ::mem::transmute(vpminq_f64(
873+
::mem::transmute(a),
874+
::mem::transmute(b),
875+
));
845876
assert_eq!(r, e);
846877
}
847878

@@ -853,7 +884,10 @@ mod tests {
853884
let b = i8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
854885
#[cfg_attr(rustfmt, skip)]
855886
let e = i8x16::new(1, 3, 6, 8, 2, 4, 6, 8, 3, 5, 7, 9, 3, 5, 7, 9);
856-
let r: i8x16 = ::mem::transmute(vpmaxq_s8(::mem::transmute(a), ::mem::transmute(b)));
887+
let r: i8x16 = ::mem::transmute(vpmaxq_s8(
888+
::mem::transmute(a),
889+
::mem::transmute(b),
890+
));
857891
assert_eq!(r, e);
858892
}
859893

@@ -862,7 +896,10 @@ mod tests {
862896
let a = i16x8::new(1, -2, 3, 4, 5, 6, 7, 8);
863897
let b = i16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
864898
let e = i16x8::new(1, 4, 6, 8, 3, 5, 7, 9);
865-
let r: i16x8 = ::mem::transmute(vpmaxq_s16(::mem::transmute(a), ::mem::transmute(b)));
899+
let r: i16x8 = ::mem::transmute(vpmaxq_s16(
900+
::mem::transmute(a),
901+
::mem::transmute(b),
902+
));
866903
assert_eq!(r, e);
867904
}
868905

@@ -871,7 +908,10 @@ mod tests {
871908
let a = i32x4::new(1, -2, 3, 4);
872909
let b = i32x4::new(0, 3, 2, 5);
873910
let e = i32x4::new(1, 4, 3, 5);
874-
let r: i32x4 = ::mem::transmute(vpmaxq_s32(::mem::transmute(a), ::mem::transmute(b)));
911+
let r: i32x4 = ::mem::transmute(vpmaxq_s32(
912+
::mem::transmute(a),
913+
::mem::transmute(b),
914+
));
875915
assert_eq!(r, e);
876916
}
877917

@@ -883,7 +923,10 @@ mod tests {
883923
let b = u8x16::new(0, 3, 2, 5, 4, 7, 6, 9, 0, 3, 2, 5, 4, 7, 6, 9);
884924
#[cfg_attr(rustfmt, skip)]
885925
let e = u8x16::new(2, 4, 6, 8, 2, 4, 6, 8, 3, 5, 7, 9, 3, 5, 7, 9);
886-
let r: u8x16 = ::mem::transmute(vpmaxq_u8(::mem::transmute(a), ::mem::transmute(b)));
926+
let r: u8x16 = ::mem::transmute(vpmaxq_u8(
927+
::mem::transmute(a),
928+
::mem::transmute(b),
929+
));
887930
assert_eq!(r, e);
888931
}
889932

@@ -892,7 +935,10 @@ mod tests {
892935
let a = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
893936
let b = u16x8::new(0, 3, 2, 5, 4, 7, 6, 9);
894937
let e = u16x8::new(2, 4, 6, 8, 3, 5, 7, 9);
895-
let r: u16x8 = ::mem::transmute(vpmaxq_u16(::mem::transmute(a), ::mem::transmute(b)));
938+
let r: u16x8 = ::mem::transmute(vpmaxq_u16(
939+
::mem::transmute(a),
940+
::mem::transmute(b),
941+
));
896942
assert_eq!(r, e);
897943
}
898944

@@ -901,7 +947,10 @@ mod tests {
901947
let a = u32x4::new(1, 2, 3, 4);
902948
let b = u32x4::new(0, 3, 2, 5);
903949
let e = u32x4::new(2, 4, 3, 5);
904-
let r: u32x4 = ::mem::transmute(vpmaxq_u32(::mem::transmute(a), ::mem::transmute(b)));
950+
let r: u32x4 = ::mem::transmute(vpmaxq_u32(
951+
::mem::transmute(a),
952+
::mem::transmute(b),
953+
));
905954
assert_eq!(r, e);
906955
}
907956

@@ -910,7 +959,10 @@ mod tests {
910959
let a = f32x4::new(1., -2., 3., 4.);
911960
let b = f32x4::new(0., 3., 2., 5.);
912961
let e = f32x4::new(1., 4., 3., 5.);
913-
let r: f32x4 = ::mem::transmute(vpmaxq_f32(::mem::transmute(a), ::mem::transmute(b)));
962+
let r: f32x4 = ::mem::transmute(vpmaxq_f32(
963+
::mem::transmute(a),
964+
::mem::transmute(b),
965+
));
914966
assert_eq!(r, e);
915967
}
916968

@@ -919,7 +971,10 @@ mod tests {
919971
let a = f64x2::new(1., -2.);
920972
let b = f64x2::new(0., 3.);
921973
let e = f64x2::new(1., 3.);
922-
let r: f64x2 = ::mem::transmute(vpmaxq_f64(::mem::transmute(a), ::mem::transmute(b)));
974+
let r: f64x2 = ::mem::transmute(vpmaxq_f64(
975+
::mem::transmute(a),
976+
::mem::transmute(b),
977+
));
923978
assert_eq!(r, e);
924979
}
925980
}

coresimd/arm/cmsis.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
//! - Core function access -- http://arm-software.github.io/CMSIS_5/Core/html/group__Core__Register__gr.html
1010
//! - Intrinsic functions for CPU instructions -- http://arm-software.github.io/CMSIS_5/Core/html/group__intrinsic__CPU__gr.html
1111
//!
12-
//! The reference C implementation used as the base of this Rust port can be found at
12+
//! The reference C implementation used as the base of this Rust port can be
13+
//! found at
1314
//!
1415
//! https://github.com/ARM-software/CMSIS_5/blob/5.3.0/CMSIS/Core/Include/cmsis_gcc.h
1516

coresimd/arm/dsp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub unsafe fn sadd8(a: int8x4_t, b: int8x4_t) -> int8x4_t {
218218
/// res = a\[0\] * b\[0\] + a\[1\] * b\[1\] + c
219219
#[inline]
220220
#[cfg_attr(test, assert_instr(smlad))]
221-
pub unsafe fn smlad(a: int16x2_t , b: int16x2_t, c: i32) -> i32 {
221+
pub unsafe fn smlad(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
222222
arm_smlad(::mem::transmute(a), ::mem::transmute(b), c)
223223
}
224224

@@ -229,7 +229,7 @@ pub unsafe fn smlad(a: int16x2_t , b: int16x2_t, c: i32) -> i32 {
229229
/// res = a\[0\] * b\[0\] - a\[1\] * b\[1\] + c
230230
#[inline]
231231
#[cfg_attr(test, assert_instr(smlsd))]
232-
pub unsafe fn smlsd(a: int16x2_t , b: int16x2_t, c: i32) -> i32 {
232+
pub unsafe fn smlsd(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
233233
arm_smlsd(::mem::transmute(a), ::mem::transmute(b), c)
234234
}
235235

coresimd/arm/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@ mod v7;
2020
#[cfg(any(target_arch = "aarch64", target_feature = "v7"))]
2121
pub use self::v7::*;
2222

23-
#[cfg(any(all(target_feature = "v7", not(target_feature = "mclass")), dox))]
23+
#[cfg(
24+
any(
25+
all(target_feature = "v7", not(target_feature = "mclass")),
26+
dox
27+
)
28+
)]
2429
mod dsp;
25-
#[cfg(any(all(target_feature = "v7", not(target_feature = "mclass")), dox))]
30+
#[cfg(
31+
any(
32+
all(target_feature = "v7", not(target_feature = "mclass")),
33+
dox
34+
)
35+
)]
2636
pub use self::dsp::*;
2737

2838
// NEON is supported on AArch64, and on ARM when built with the v7 and neon

0 commit comments

Comments
 (0)