Skip to content

Commit f5e809e

Browse files
committed
correct test cases of vshr
1 parent 1eb1413 commit f5e809e

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

crates/core_arch/src/arm/neon/generated.rs

+28-28
Original file line numberDiff line numberDiff line change
@@ -14656,48 +14656,48 @@ mod test {
1465614656

1465714657
#[simd_test(enable = "neon")]
1465814658
unsafe fn test_vshr_n_s8() {
14659-
let a: i8x8 = i8x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14660-
let e: i8x8 = i8x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14659+
let a: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14660+
let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1466114661
let r: i8x8 = transmute(vshr_n_s8::<2>(transmute(a)));
1466214662
assert_eq!(r, e);
1466314663
}
1466414664

1466514665
#[simd_test(enable = "neon")]
1466614666
unsafe fn test_vshrq_n_s8() {
14667-
let a: i8x16 = i8x16::new(4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0);
14668-
let e: i8x16 = i8x16::new(1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0);
14667+
let a: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
14668+
let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
1466914669
let r: i8x16 = transmute(vshrq_n_s8::<2>(transmute(a)));
1467014670
assert_eq!(r, e);
1467114671
}
1467214672

1467314673
#[simd_test(enable = "neon")]
1467414674
unsafe fn test_vshr_n_s16() {
14675-
let a: i16x4 = i16x4::new(4, 0, 12, 0);
14676-
let e: i16x4 = i16x4::new(1, 0, 3, 0);
14675+
let a: i16x4 = i16x4::new(4, 8, 12, 16);
14676+
let e: i16x4 = i16x4::new(1, 2, 3, 4);
1467714677
let r: i16x4 = transmute(vshr_n_s16::<2>(transmute(a)));
1467814678
assert_eq!(r, e);
1467914679
}
1468014680

1468114681
#[simd_test(enable = "neon")]
1468214682
unsafe fn test_vshrq_n_s16() {
14683-
let a: i16x8 = i16x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14684-
let e: i16x8 = i16x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14683+
let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14684+
let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1468514685
let r: i16x8 = transmute(vshrq_n_s16::<2>(transmute(a)));
1468614686
assert_eq!(r, e);
1468714687
}
1468814688

1468914689
#[simd_test(enable = "neon")]
1469014690
unsafe fn test_vshr_n_s32() {
14691-
let a: i32x2 = i32x2::new(4, 0);
14692-
let e: i32x2 = i32x2::new(1, 0);
14691+
let a: i32x2 = i32x2::new(4, 8);
14692+
let e: i32x2 = i32x2::new(1, 2);
1469314693
let r: i32x2 = transmute(vshr_n_s32::<2>(transmute(a)));
1469414694
assert_eq!(r, e);
1469514695
}
1469614696

1469714697
#[simd_test(enable = "neon")]
1469814698
unsafe fn test_vshrq_n_s32() {
14699-
let a: i32x4 = i32x4::new(4, 0, 12, 0);
14700-
let e: i32x4 = i32x4::new(1, 0, 3, 0);
14699+
let a: i32x4 = i32x4::new(4, 8, 12, 16);
14700+
let e: i32x4 = i32x4::new(1, 2, 3, 4);
1470114701
let r: i32x4 = transmute(vshrq_n_s32::<2>(transmute(a)));
1470214702
assert_eq!(r, e);
1470314703
}
@@ -14712,56 +14712,56 @@ mod test {
1471214712

1471314713
#[simd_test(enable = "neon")]
1471414714
unsafe fn test_vshrq_n_s64() {
14715-
let a: i64x2 = i64x2::new(4, 0);
14716-
let e: i64x2 = i64x2::new(1, 0);
14715+
let a: i64x2 = i64x2::new(4, 8);
14716+
let e: i64x2 = i64x2::new(1, 2);
1471714717
let r: i64x2 = transmute(vshrq_n_s64::<2>(transmute(a)));
1471814718
assert_eq!(r, e);
1471914719
}
1472014720

1472114721
#[simd_test(enable = "neon")]
1472214722
unsafe fn test_vshr_n_u8() {
14723-
let a: u8x8 = u8x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14724-
let e: u8x8 = u8x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14723+
let a: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14724+
let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1472514725
let r: u8x8 = transmute(vshr_n_u8::<2>(transmute(a)));
1472614726
assert_eq!(r, e);
1472714727
}
1472814728

1472914729
#[simd_test(enable = "neon")]
1473014730
unsafe fn test_vshrq_n_u8() {
14731-
let a: u8x16 = u8x16::new(4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0);
14732-
let e: u8x16 = u8x16::new(1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0);
14731+
let a: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
14732+
let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
1473314733
let r: u8x16 = transmute(vshrq_n_u8::<2>(transmute(a)));
1473414734
assert_eq!(r, e);
1473514735
}
1473614736

1473714737
#[simd_test(enable = "neon")]
1473814738
unsafe fn test_vshr_n_u16() {
14739-
let a: u16x4 = u16x4::new(4, 0, 12, 0);
14740-
let e: u16x4 = u16x4::new(1, 0, 3, 0);
14739+
let a: u16x4 = u16x4::new(4, 8, 12, 16);
14740+
let e: u16x4 = u16x4::new(1, 2, 3, 4);
1474114741
let r: u16x4 = transmute(vshr_n_u16::<2>(transmute(a)));
1474214742
assert_eq!(r, e);
1474314743
}
1474414744

1474514745
#[simd_test(enable = "neon")]
1474614746
unsafe fn test_vshrq_n_u16() {
14747-
let a: u16x8 = u16x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14748-
let e: u16x8 = u16x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14747+
let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14748+
let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1474914749
let r: u16x8 = transmute(vshrq_n_u16::<2>(transmute(a)));
1475014750
assert_eq!(r, e);
1475114751
}
1475214752

1475314753
#[simd_test(enable = "neon")]
1475414754
unsafe fn test_vshr_n_u32() {
14755-
let a: u32x2 = u32x2::new(4, 0);
14756-
let e: u32x2 = u32x2::new(1, 0);
14755+
let a: u32x2 = u32x2::new(4, 8);
14756+
let e: u32x2 = u32x2::new(1, 2);
1475714757
let r: u32x2 = transmute(vshr_n_u32::<2>(transmute(a)));
1475814758
assert_eq!(r, e);
1475914759
}
1476014760

1476114761
#[simd_test(enable = "neon")]
1476214762
unsafe fn test_vshrq_n_u32() {
14763-
let a: u32x4 = u32x4::new(4, 0, 12, 0);
14764-
let e: u32x4 = u32x4::new(1, 0, 3, 0);
14763+
let a: u32x4 = u32x4::new(4, 8, 12, 16);
14764+
let e: u32x4 = u32x4::new(1, 2, 3, 4);
1476514765
let r: u32x4 = transmute(vshrq_n_u32::<2>(transmute(a)));
1476614766
assert_eq!(r, e);
1476714767
}
@@ -14776,8 +14776,8 @@ mod test {
1477614776

1477714777
#[simd_test(enable = "neon")]
1477814778
unsafe fn test_vshrq_n_u64() {
14779-
let a: u64x2 = u64x2::new(4, 0);
14780-
let e: u64x2 = u64x2::new(1, 0);
14779+
let a: u64x2 = u64x2::new(4, 8);
14780+
let e: u64x2 = u64x2::new(1, 2);
1478114781
let r: u64x2 = transmute(vshrq_n_u64::<2>(transmute(a)));
1478214782
assert_eq!(r, e);
1478314783
}

crates/stdarch-gen/neon.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2136,9 +2136,9 @@ n-suffix
21362136
constn = N
21372137
multi_fn = static_assert-N-1-bits
21382138
multi_fn = simd_shr, a, {vdup-nself-noext, N.try_into().unwrap()}
2139-
a = 4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0
2139+
a = 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
21402140
n = 2
2141-
validate 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0
2141+
validate 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
21422142

21432143
arm = vshr.s
21442144
aarch64 = sshr

0 commit comments

Comments
 (0)