Skip to content
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
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ case ${TARGET} in
export RUSTFLAGS="${RUSTFLAGS} -C llvm-args=-fast-isel=false"
;;
armv7-*eabihf | thumbv7-*eabihf)
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon"
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon,+fp16"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since fp16 cannot be checked at runtime (at least is_arm_feature_detected does not support it), we enable it at compile time.

;;
amdgcn-*)
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-cpu=gfx1200"
Expand Down
3 changes: 0 additions & 3 deletions crates/core_arch/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
ignore = [
"src/simd.rs",
]
97 changes: 49 additions & 48 deletions crates/core_arch/src/arm_shared/neon/load_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,194 +13,195 @@ use crate::core_arch::aarch64::*;
use crate::core_arch::simd::*;
use std::mem;
use stdarch_test::simd_test;

#[simd_test(enable = "neon")]
unsafe fn test_vld1_s8() {
fn test_vld1_s8() {
let a: [i8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: i8x8 = transmute(vld1_s8(a[1..].as_ptr()));
let r = unsafe { i8x8::from(vld1_s8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_s8() {
fn test_vld1q_s8() {
let a: [i8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let e = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let r: i8x16 = transmute(vld1q_s8(a[1..].as_ptr()));
let r = unsafe { i8x16::from(vld1q_s8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_s16() {
fn test_vld1_s16() {
let a: [i16; 5] = [0, 1, 2, 3, 4];
let e = i16x4::new(1, 2, 3, 4);
let r: i16x4 = transmute(vld1_s16(a[1..].as_ptr()));
let r = unsafe { i16x4::from(vld1_s16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_s16() {
fn test_vld1q_s16() {
let a: [i16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: i16x8 = transmute(vld1q_s16(a[1..].as_ptr()));
let r = unsafe { i16x8::from(vld1q_s16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_s32() {
fn test_vld1_s32() {
let a: [i32; 3] = [0, 1, 2];
let e = i32x2::new(1, 2);
let r: i32x2 = transmute(vld1_s32(a[1..].as_ptr()));
let r = unsafe { i32x2::from(vld1_s32(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_s32() {
fn test_vld1q_s32() {
let a: [i32; 5] = [0, 1, 2, 3, 4];
let e = i32x4::new(1, 2, 3, 4);
let r: i32x4 = transmute(vld1q_s32(a[1..].as_ptr()));
let r = unsafe { i32x4::from(vld1q_s32(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_s64() {
fn test_vld1_s64() {
let a: [i64; 2] = [0, 1];
let e = i64x1::new(1);
let r: i64x1 = transmute(vld1_s64(a[1..].as_ptr()));
let r = unsafe { i64x1::from(vld1_s64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_s64() {
fn test_vld1q_s64() {
let a: [i64; 3] = [0, 1, 2];
let e = i64x2::new(1, 2);
let r: i64x2 = transmute(vld1q_s64(a[1..].as_ptr()));
let r = unsafe { i64x2::from(vld1q_s64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_u8() {
fn test_vld1_u8() {
let a: [u8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: u8x8 = transmute(vld1_u8(a[1..].as_ptr()));
let r = unsafe { u8x8::from(vld1_u8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_u8() {
fn test_vld1q_u8() {
let a: [u8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let e = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let r: u8x16 = transmute(vld1q_u8(a[1..].as_ptr()));
let r = unsafe { u8x16::from(vld1q_u8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_u16() {
fn test_vld1_u16() {
let a: [u16; 5] = [0, 1, 2, 3, 4];
let e = u16x4::new(1, 2, 3, 4);
let r: u16x4 = transmute(vld1_u16(a[1..].as_ptr()));
let r = unsafe { u16x4::from(vld1_u16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_u16() {
fn test_vld1q_u16() {
let a: [u16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: u16x8 = transmute(vld1q_u16(a[1..].as_ptr()));
let r = unsafe { u16x8::from(vld1q_u16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_u32() {
fn test_vld1_u32() {
let a: [u32; 3] = [0, 1, 2];
let e = u32x2::new(1, 2);
let r: u32x2 = transmute(vld1_u32(a[1..].as_ptr()));
let r = unsafe { u32x2::from(vld1_u32(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_u32() {
fn test_vld1q_u32() {
let a: [u32; 5] = [0, 1, 2, 3, 4];
let e = u32x4::new(1, 2, 3, 4);
let r: u32x4 = transmute(vld1q_u32(a[1..].as_ptr()));
let r = unsafe { u32x4::from(vld1q_u32(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_u64() {
fn test_vld1_u64() {
let a: [u64; 2] = [0, 1];
let e = u64x1::new(1);
let r: u64x1 = transmute(vld1_u64(a[1..].as_ptr()));
let r = unsafe { u64x1::from(vld1_u64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_u64() {
fn test_vld1q_u64() {
let a: [u64; 3] = [0, 1, 2];
let e = u64x2::new(1, 2);
let r: u64x2 = transmute(vld1q_u64(a[1..].as_ptr()));
let r = unsafe { u64x2::from(vld1q_u64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_p8() {
fn test_vld1_p8() {
let a: [p8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: u8x8 = transmute(vld1_p8(a[1..].as_ptr()));
let r = unsafe { u8x8::from(vld1_p8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_p8() {
fn test_vld1q_p8() {
let a: [p8; 17] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
let e = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let r: u8x16 = transmute(vld1q_p8(a[1..].as_ptr()));
let r = unsafe { u8x16::from(vld1q_p8(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_p16() {
fn test_vld1_p16() {
let a: [p16; 5] = [0, 1, 2, 3, 4];
let e = u16x4::new(1, 2, 3, 4);
let r: u16x4 = transmute(vld1_p16(a[1..].as_ptr()));
let r = unsafe { u16x4::from(vld1_p16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_p16() {
fn test_vld1q_p16() {
let a: [p16; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
let e = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
let r: u16x8 = transmute(vld1q_p16(a[1..].as_ptr()));
let r = unsafe { u16x8::from(vld1q_p16(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon,aes")]
unsafe fn test_vld1_p64() {
fn test_vld1_p64() {
let a: [p64; 2] = [0, 1];
let e = u64x1::new(1);
let r: u64x1 = transmute(vld1_p64(a[1..].as_ptr()));
let r = unsafe { u64x1::from(vld1_p64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon,aes")]
unsafe fn test_vld1q_p64() {
fn test_vld1q_p64() {
let a: [p64; 3] = [0, 1, 2];
let e = u64x2::new(1, 2);
let r: u64x2 = transmute(vld1q_p64(a[1..].as_ptr()));
let r = unsafe { u64x2::from(vld1q_p64(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1_f32() {
fn test_vld1_f32() {
let a: [f32; 3] = [0., 1., 2.];
let e = f32x2::new(1., 2.);
let r: f32x2 = transmute(vld1_f32(a[1..].as_ptr()));
let r = unsafe { f32x2::from(vld1_f32(a[1..].as_ptr())) };
assert_eq!(r, e)
}

#[simd_test(enable = "neon")]
unsafe fn test_vld1q_f32() {
fn test_vld1q_f32() {
let a: [f32; 5] = [0., 1., 2., 3., 4.];
let e = f32x4::new(1., 2., 3., 4.);
let r: f32x4 = transmute(vld1q_f32(a[1..].as_ptr()));
let r = unsafe { f32x4::from(vld1q_f32(a[1..].as_ptr())) };
assert_eq!(r, e)
}
Loading