Skip to content

Commit 484459c

Browse files
committed
correct vshld_s64 and vshld_u64
1 parent eda93d1 commit 484459c

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4738,25 +4738,15 @@ pub unsafe fn vrsrad_n_u64<const N: i32>(a: u64, b: u64) -> u64 {
47384738
#[target_feature(enable = "neon")]
47394739
#[cfg_attr(test, assert_instr(sshl))]
47404740
pub unsafe fn vshld_s64(a: i64, b: i64) -> i64 {
4741-
#[allow(improper_ctypes)]
4742-
extern "C" {
4743-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sshl.i64")]
4744-
fn vshld_s64_(a: i64, b: i64) -> i64;
4745-
}
4746-
vshld_s64_(a, b)
4741+
transmute(vshl_s64(transmute(a), transmute(b)))
47474742
}
47484743

47494744
/// Unsigned Shift left
47504745
#[inline]
47514746
#[target_feature(enable = "neon")]
47524747
#[cfg_attr(test, assert_instr(ushl))]
47534748
pub unsafe fn vshld_u64(a: u64, b: i64) -> u64 {
4754-
#[allow(improper_ctypes)]
4755-
extern "C" {
4756-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ushl.i64")]
4757-
fn vshld_u64_(a: u64, b: i64) -> u64;
4758-
}
4759-
vshld_u64_(a, b)
4749+
transmute(vshl_u64(transmute(a), transmute(b)))
47604750
}
47614751

47624752
/// Signed shift left long

crates/stdarch-gen/neon.spec

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,30 +2906,47 @@ a = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
29062906
b = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
29072907
validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
29082908

2909-
aarch64 = sshl
2910-
link-aarch64 = sshl._EXT_
2911-
generate i64
2912-
29132909
arm = vshl
29142910
link-arm = vshifts._EXT_
2911+
aarch64 = sshl
2912+
link-aarch64 = sshl._EXT_
29152913
generate int*_t, int64x*_t
29162914

2915+
/// Signed Shift left
2916+
name = vshl
2917+
multi_fn = transmute, {vshl-in_ntt-noext, transmute(a), transmute(b)}
2918+
a = 1
2919+
b = 2
2920+
validate 4
2921+
2922+
aarch64 = sshl
2923+
generate i64
2924+
29172925
/// Unsigned Shift left
29182926
name = vshl
29192927
out-suffix
29202928
a = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
29212929
b = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
29222930
validate 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64
29232931

2924-
aarch64 = ushl
2925-
link-aarch64 = ushl._EXT_
2926-
generate u64:i64:u64
2927-
29282932
arm = vshl
29292933
link-arm = vshiftu._EXT_
2934+
aarch64 = ushl
2935+
link-aarch64 = ushl._EXT_
29302936
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
29312937
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
29322938

2939+
/// Unsigned Shift left
2940+
out-suffix
2941+
name = vshl
2942+
multi_fn = transmute, {vshl-out_ntt-noext, transmute(a), transmute(b)}
2943+
a = 1
2944+
b = 2
2945+
validate 4
2946+
2947+
aarch64 = ushl
2948+
generate u64:i64:u64
2949+
29332950
/// Shift left
29342951
name = vshl
29352952
n-suffix

0 commit comments

Comments
 (0)