Skip to content

Commit b8bdeb5

Browse files
committed
correct test cases of vshr
1 parent 53906fb commit b8bdeb5

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
@@ -14416,48 +14416,48 @@ mod test {
1441614416

1441714417
#[simd_test(enable = "neon")]
1441814418
unsafe fn test_vshr_n_s8() {
14419-
let a: i8x8 = i8x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14420-
let e: i8x8 = i8x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14419+
let a: i8x8 = i8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14420+
let e: i8x8 = i8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1442114421
let r: i8x8 = transmute(vshr_n_s8::<2>(transmute(a)));
1442214422
assert_eq!(r, e);
1442314423
}
1442414424

1442514425
#[simd_test(enable = "neon")]
1442614426
unsafe fn test_vshrq_n_s8() {
14427-
let a: i8x16 = i8x16::new(4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0);
14428-
let e: i8x16 = i8x16::new(1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0);
14427+
let a: i8x16 = i8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
14428+
let e: i8x16 = i8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
1442914429
let r: i8x16 = transmute(vshrq_n_s8::<2>(transmute(a)));
1443014430
assert_eq!(r, e);
1443114431
}
1443214432

1443314433
#[simd_test(enable = "neon")]
1443414434
unsafe fn test_vshr_n_s16() {
14435-
let a: i16x4 = i16x4::new(4, 0, 12, 0);
14436-
let e: i16x4 = i16x4::new(1, 0, 3, 0);
14435+
let a: i16x4 = i16x4::new(4, 8, 12, 16);
14436+
let e: i16x4 = i16x4::new(1, 2, 3, 4);
1443714437
let r: i16x4 = transmute(vshr_n_s16::<2>(transmute(a)));
1443814438
assert_eq!(r, e);
1443914439
}
1444014440

1444114441
#[simd_test(enable = "neon")]
1444214442
unsafe fn test_vshrq_n_s16() {
14443-
let a: i16x8 = i16x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14444-
let e: i16x8 = i16x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14443+
let a: i16x8 = i16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14444+
let e: i16x8 = i16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1444514445
let r: i16x8 = transmute(vshrq_n_s16::<2>(transmute(a)));
1444614446
assert_eq!(r, e);
1444714447
}
1444814448

1444914449
#[simd_test(enable = "neon")]
1445014450
unsafe fn test_vshr_n_s32() {
14451-
let a: i32x2 = i32x2::new(4, 0);
14452-
let e: i32x2 = i32x2::new(1, 0);
14451+
let a: i32x2 = i32x2::new(4, 8);
14452+
let e: i32x2 = i32x2::new(1, 2);
1445314453
let r: i32x2 = transmute(vshr_n_s32::<2>(transmute(a)));
1445414454
assert_eq!(r, e);
1445514455
}
1445614456

1445714457
#[simd_test(enable = "neon")]
1445814458
unsafe fn test_vshrq_n_s32() {
14459-
let a: i32x4 = i32x4::new(4, 0, 12, 0);
14460-
let e: i32x4 = i32x4::new(1, 0, 3, 0);
14459+
let a: i32x4 = i32x4::new(4, 8, 12, 16);
14460+
let e: i32x4 = i32x4::new(1, 2, 3, 4);
1446114461
let r: i32x4 = transmute(vshrq_n_s32::<2>(transmute(a)));
1446214462
assert_eq!(r, e);
1446314463
}
@@ -14472,56 +14472,56 @@ mod test {
1447214472

1447314473
#[simd_test(enable = "neon")]
1447414474
unsafe fn test_vshrq_n_s64() {
14475-
let a: i64x2 = i64x2::new(4, 0);
14476-
let e: i64x2 = i64x2::new(1, 0);
14475+
let a: i64x2 = i64x2::new(4, 8);
14476+
let e: i64x2 = i64x2::new(1, 2);
1447714477
let r: i64x2 = transmute(vshrq_n_s64::<2>(transmute(a)));
1447814478
assert_eq!(r, e);
1447914479
}
1448014480

1448114481
#[simd_test(enable = "neon")]
1448214482
unsafe fn test_vshr_n_u8() {
14483-
let a: u8x8 = u8x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14484-
let e: u8x8 = u8x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14483+
let a: u8x8 = u8x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14484+
let e: u8x8 = u8x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1448514485
let r: u8x8 = transmute(vshr_n_u8::<2>(transmute(a)));
1448614486
assert_eq!(r, e);
1448714487
}
1448814488

1448914489
#[simd_test(enable = "neon")]
1449014490
unsafe fn test_vshrq_n_u8() {
14491-
let a: u8x16 = u8x16::new(4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0);
14492-
let e: u8x16 = u8x16::new(1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0);
14491+
let a: u8x16 = u8x16::new(4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64);
14492+
let e: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
1449314493
let r: u8x16 = transmute(vshrq_n_u8::<2>(transmute(a)));
1449414494
assert_eq!(r, e);
1449514495
}
1449614496

1449714497
#[simd_test(enable = "neon")]
1449814498
unsafe fn test_vshr_n_u16() {
14499-
let a: u16x4 = u16x4::new(4, 0, 12, 0);
14500-
let e: u16x4 = u16x4::new(1, 0, 3, 0);
14499+
let a: u16x4 = u16x4::new(4, 8, 12, 16);
14500+
let e: u16x4 = u16x4::new(1, 2, 3, 4);
1450114501
let r: u16x4 = transmute(vshr_n_u16::<2>(transmute(a)));
1450214502
assert_eq!(r, e);
1450314503
}
1450414504

1450514505
#[simd_test(enable = "neon")]
1450614506
unsafe fn test_vshrq_n_u16() {
14507-
let a: u16x8 = u16x8::new(4, 0, 12, 0, 20, 0, 28, 0);
14508-
let e: u16x8 = u16x8::new(1, 0, 3, 0, 5, 0, 7, 0);
14507+
let a: u16x8 = u16x8::new(4, 8, 12, 16, 20, 24, 28, 32);
14508+
let e: u16x8 = u16x8::new(1, 2, 3, 4, 5, 6, 7, 8);
1450914509
let r: u16x8 = transmute(vshrq_n_u16::<2>(transmute(a)));
1451014510
assert_eq!(r, e);
1451114511
}
1451214512

1451314513
#[simd_test(enable = "neon")]
1451414514
unsafe fn test_vshr_n_u32() {
14515-
let a: u32x2 = u32x2::new(4, 0);
14516-
let e: u32x2 = u32x2::new(1, 0);
14515+
let a: u32x2 = u32x2::new(4, 8);
14516+
let e: u32x2 = u32x2::new(1, 2);
1451714517
let r: u32x2 = transmute(vshr_n_u32::<2>(transmute(a)));
1451814518
assert_eq!(r, e);
1451914519
}
1452014520

1452114521
#[simd_test(enable = "neon")]
1452214522
unsafe fn test_vshrq_n_u32() {
14523-
let a: u32x4 = u32x4::new(4, 0, 12, 0);
14524-
let e: u32x4 = u32x4::new(1, 0, 3, 0);
14523+
let a: u32x4 = u32x4::new(4, 8, 12, 16);
14524+
let e: u32x4 = u32x4::new(1, 2, 3, 4);
1452514525
let r: u32x4 = transmute(vshrq_n_u32::<2>(transmute(a)));
1452614526
assert_eq!(r, e);
1452714527
}
@@ -14536,8 +14536,8 @@ mod test {
1453614536

1453714537
#[simd_test(enable = "neon")]
1453814538
unsafe fn test_vshrq_n_u64() {
14539-
let a: u64x2 = u64x2::new(4, 0);
14540-
let e: u64x2 = u64x2::new(1, 0);
14539+
let a: u64x2 = u64x2::new(4, 8);
14540+
let e: u64x2 = u64x2::new(1, 2);
1454114541
let r: u64x2 = transmute(vshrq_n_u64::<2>(transmute(a)));
1454214542
assert_eq!(r, e);
1454314543
}

crates/stdarch-gen/neon.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1914,9 +1914,9 @@ n-suffix
19141914
constn = N
19151915
multi_fn = static_assert-N-1-bits
19161916
multi_fn = simd_shr, a, {vdup-nself-noext, N.try_into().unwrap()}
1917-
a = 4, 0, 12, 0, 20, 0, 28, 0, 36, 0, 44, 0, 52, 0, 60, 0
1917+
a = 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
19181918
n = 2
1919-
validate 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0
1919+
validate 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
19201920

19211921
arm = vshr.s
19221922
aarch64 = sshr

0 commit comments

Comments
 (0)