Skip to content

Commit fcf879d

Browse files
committed
correct assert_instr
1 parent 484459c commit fcf879d

File tree

4 files changed

+41
-32
lines changed

4 files changed

+41
-32
lines changed

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4610,25 +4610,15 @@ pub unsafe fn vreinterpretq_f32_f64(a: float64x2_t) -> float32x4_t {
46104610
#[target_feature(enable = "neon")]
46114611
#[cfg_attr(test, assert_instr(srshl))]
46124612
pub unsafe fn vrshld_s64(a: i64, b: i64) -> i64 {
4613-
#[allow(improper_ctypes)]
4614-
extern "C" {
4615-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.srshl.i64")]
4616-
fn vrshld_s64_(a: i64, b: i64) -> i64;
4617-
}
4618-
vrshld_s64_(a, b)
4613+
trnansmute(vrshl_s64(transmute(a), transmute(b)))
46194614
}
46204615

46214616
/// Unsigned rounding shift left
46224617
#[inline]
46234618
#[target_feature(enable = "neon")]
46244619
#[cfg_attr(test, assert_instr(urshl))]
46254620
pub unsafe fn vrshld_u64(a: u64, b: i64) -> u64 {
4626-
#[allow(improper_ctypes)]
4627-
extern "C" {
4628-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.urshl.i64")]
4629-
fn vrshld_u64_(a: u64, b: i64) -> u64;
4630-
}
4631-
vrshld_u64_(a, b)
4621+
trnansmute(vrshl_u64(transmute(a), transmute(b)))
46324622
}
46334623

46344624
/// Signed rounding shift right
@@ -4714,7 +4704,7 @@ pub unsafe fn vrshrn_high_n_u64<const N: i32>(a: uint32x2_t, b: uint64x2_t) -> u
47144704
/// Signed rounding shift right and accumulate
47154705
#[inline]
47164706
#[target_feature(enable = "neon")]
4717-
#[cfg_attr(test, assert_instr(srsra, N = 2))]
4707+
#[cfg_attr(test, assert_instr(nop, N = 2))]
47184708
#[rustc_legacy_const_generics(2)]
47194709
pub unsafe fn vrsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
47204710
static_assert!(N : i32 where N >= 1 && N <= 64);
@@ -4725,7 +4715,7 @@ pub unsafe fn vrsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
47254715
/// Ungisned rounding shift right and accumulate
47264716
#[inline]
47274717
#[target_feature(enable = "neon")]
4728-
#[cfg_attr(test, assert_instr(ursra, N = 2))]
4718+
#[cfg_attr(test, assert_instr(nop, N = 2))]
47294719
#[rustc_legacy_const_generics(2)]
47304720
pub unsafe fn vrsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
47314721
static_assert!(N : i32 where N >= 1 && N <= 64);

crates/core_arch/src/aarch64/neon/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,7 +2450,7 @@ pub unsafe fn vqtbx4q_p8(a: poly8x16_t, t: poly8x16x4_t, idx: uint8x16_t) -> pol
24502450
/// Shift left
24512451
#[inline]
24522452
#[target_feature(enable = "neon")]
2453-
#[cfg_attr(test, assert_instr(shl, N = 2))]
2453+
#[cfg_attr(test, assert_instr(nop, N = 2))]
24542454
#[rustc_legacy_const_generics(1)]
24552455
pub unsafe fn vshld_n_s64<const N: i32>(a: i64) -> i64 {
24562456
static_assert_imm6!(N);
@@ -2460,7 +2460,7 @@ pub unsafe fn vshld_n_s64<const N: i32>(a: i64) -> i64 {
24602460
/// Shift left
24612461
#[inline]
24622462
#[target_feature(enable = "neon")]
2463-
#[cfg_attr(test, assert_instr(shl, N = 2))]
2463+
#[cfg_attr(test, assert_instr(nop, N = 2))]
24642464
#[rustc_legacy_const_generics(1)]
24652465
pub unsafe fn vshld_n_u64<const N: i32>(a: u64) -> u64 {
24662466
static_assert_imm6!(N);
@@ -2470,7 +2470,7 @@ pub unsafe fn vshld_n_u64<const N: i32>(a: u64) -> u64 {
24702470
/// Signed shift right
24712471
#[inline]
24722472
#[target_feature(enable = "neon")]
2473-
#[cfg_attr(test, assert_instr(sshr, N = 2))]
2473+
#[cfg_attr(test, assert_instr(nop, N = 2))]
24742474
#[rustc_legacy_const_generics(1)]
24752475
pub unsafe fn vshrd_n_s64<const N: i32>(a: i64) -> i64 {
24762476
static_assert!(N : i32 where N >= 1 && N <= 64);
@@ -2480,7 +2480,7 @@ pub unsafe fn vshrd_n_s64<const N: i32>(a: i64) -> i64 {
24802480
/// Unsigned shift right
24812481
#[inline]
24822482
#[target_feature(enable = "neon")]
2483-
#[cfg_attr(test, assert_instr(ushr, N = 2))]
2483+
#[cfg_attr(test, assert_instr(nop, N = 2))]
24842484
#[rustc_legacy_const_generics(1)]
24852485
pub unsafe fn vshrd_n_u64<const N: i32>(a: u64) -> u64 {
24862486
static_assert!(N : i32 where N >= 1 && N <= 64);
@@ -2490,7 +2490,7 @@ pub unsafe fn vshrd_n_u64<const N: i32>(a: u64) -> u64 {
24902490
/// Signed shift right and accumulate
24912491
#[inline]
24922492
#[target_feature(enable = "neon")]
2493-
#[cfg_attr(test, assert_instr(ssra, N = 2))]
2493+
#[cfg_attr(test, assert_instr(nop, N = 2))]
24942494
#[rustc_legacy_const_generics(2)]
24952495
pub unsafe fn vsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
24962496
static_assert!(N : i32 where N >= 1 && N <= 64);
@@ -2500,7 +2500,7 @@ pub unsafe fn vsrad_n_s64<const N: i32>(a: i64, b: i64) -> i64 {
25002500
/// Unsigned shift right and accumulate
25012501
#[inline]
25022502
#[target_feature(enable = "neon")]
2503-
#[cfg_attr(test, assert_instr(usra, N = 2))]
2503+
#[cfg_attr(test, assert_instr(nop, N = 2))]
25042504
#[rustc_legacy_const_generics(2)]
25052505
pub unsafe fn vsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
25062506
static_assert!(N : i32 where N >= 1 && N <= 64);

crates/stdarch-gen/neon.spec

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,12 +2717,21 @@ validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
27172717

27182718
aarch64 = srshl
27192719
link-aarch64 = srshl._EXT_
2720-
generate i64
27212720

27222721
arm = vrshl
27232722
link-arm = vrshifts._EXT_
27242723
generate int*_t, int64x*_t
27252724

2725+
/// Signed rounding shift left
2726+
name = vrshl
2727+
multi_fn = trnansmute, {vrshl-in_ntt-noext, transmute(a), transmute(b)}
2728+
a = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
2729+
b = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
2730+
validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
2731+
2732+
aarch64 = srshl
2733+
generate i64
2734+
27262735
/// Unsigned rounding shift left
27272736
name = vrshl
27282737
out-suffix
@@ -2732,13 +2741,23 @@ validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
27322741

27332742
aarch64 = urshl
27342743
link-aarch64 = urshl._EXT_
2735-
generate u64:i64:u64
27362744

27372745
arm = vrshl
27382746
link-arm = vrshiftu._EXT_
27392747
generate uint8x8_t:int8x8_t:uint8x8_t, uint8x16_t:int8x16_t:uint8x16_t, uint16x4_t:int16x4_t:uint16x4_t, uint16x8_t:int16x8_t:uint16x8_t
27402748
generate uint32x2_t:int32x2_t:uint32x2_t, uint32x4_t:int32x4_t:uint32x4_t, uint64x1_t:int64x1_t:uint64x1_t, uint64x2_t:int64x2_t:uint64x2_t
27412749

2750+
/// Unsigned rounding shift left
2751+
name = vrshl
2752+
out-suffix
2753+
multi_fn = trnansmute, {vrshl-out_ntt-noext, transmute(a), transmute(b)}
2754+
a = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
2755+
b = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
2756+
validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
2757+
2758+
aarch64 = urshl
2759+
generate u64:i64:u64
2760+
27422761
/// Signed rounding shift right
27432762
name = vrshr
27442763
n-suffix
@@ -2882,7 +2901,7 @@ b = 4
28822901
n = 2
28832902
validate 2
28842903

2885-
aarch64 = srsra
2904+
aarch64 = nop
28862905
generate i64
28872906

28882907
/// Ungisned rounding shift right and accumulate
@@ -2897,7 +2916,7 @@ b = 4
28972916
n = 2
28982917
validate 2
28992918

2900-
aarch64 = ursra
2919+
aarch64 = nop
29012920
generate u64
29022921

29032922
/// Signed Shift left

crates/stdarch-gen/src/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,14 @@ fn type_to_ext(t: &str) -> &str {
482482
"poly8x16_t" => "v16i8",
483483
"poly16x4_t" => "v4i16",
484484
"poly16x8_t" => "v8i16",
485-
"i8" => "i8",
486-
"i16" => "i16",
487-
"i32" => "i32",
488-
"i64" => "i64",
489-
"u8" => "i8",
490-
"u16" => "i16",
491-
"u32" => "i32",
492-
"u64" => "i64",
485+
"i8" => "v8i8",
486+
"i16" => "v4i16",
487+
"i32" => "v2i32",
488+
"i64" => "v1i64",
489+
"u8" => "v8i8",
490+
"u16" => "v4i16",
491+
"u32" => "v2i32",
492+
"u64" => "v1i64",
493493
/*
494494
"poly64x1_t" => "i64x1",
495495
"poly64x2_t" => "i64x2",

0 commit comments

Comments
 (0)