Skip to content

Commit bba6d40

Browse files
committed
Add vscode to git ignore
1 parent 71a3515 commit bba6d40

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

crates/core_arch/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/core_arch/src/arm/neon.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,16 +1545,16 @@ pub unsafe fn vmovq_n_u8(value: u8) -> uint8x16_t {
15451545
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
15461546
#[cfg_attr(test, assert_instr(ld1))]
15471547
pub unsafe fn vld1q_s8(addr: *const i8) -> int8x16_t {
1548-
*(addr as *const int8x16_t)
1548+
ptr::read(addr as *const int8x16_t)
15491549
}
15501550

1551-
/// int8x16_t vld1q_s8 (int8_t const * ptr)
1551+
/// int8x16_t vld1q_u8 (uint8_t const * ptr)
15521552
#[inline]
15531553
#[target_feature(enable = "neon")]
15541554
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
15551555
#[cfg_attr(test, assert_instr(ld1))]
15561556
pub unsafe fn vld1q_u8(addr: *const u8) -> uint8x16_t {
1557-
*(addr as *const uint8x16_t)
1557+
ptr::read(addr as *const uint8x16_t)
15581558
}
15591559

15601560
/// void vst1q_u8 (uint8_t * ptr, uint8x16_t val)
@@ -1602,6 +1602,9 @@ arm_reinterpret!(vreinterpretq_u8_s8, int8x16_t, uint8x16_t);
16021602
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
16031603
#[cfg_attr(test, assert_instr(ext))]
16041604
pub unsafe fn vextq_s8(a: int8x16_t, b: int8x16_t, n: i32) -> int8x16_t {
1605+
if n < 0 || n > 16 {
1606+
unreachable_unchecked();
1607+
};
16051608
match n {
16061609
0 => b,
16071610
1 => int8x16_t(
@@ -1660,6 +1663,9 @@ pub unsafe fn vextq_s8(a: int8x16_t, b: int8x16_t, n: i32) -> int8x16_t {
16601663
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
16611664
#[cfg_attr(test, assert_instr(ushr))]
16621665
pub unsafe fn vshrq_n_u8(a: uint8x16_t, n: i32) -> uint8x16_t {
1666+
if n < 0 || n > 7 {
1667+
unreachable_unchecked();
1668+
};
16631669
uint8x16_t(
16641670
a.0 >> n,
16651671
a.1 >> n,
@@ -1686,6 +1692,9 @@ pub unsafe fn vshrq_n_u8(a: uint8x16_t, n: i32) -> uint8x16_t {
16861692
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
16871693
#[cfg_attr(test, assert_instr(ushl))]
16881694
pub unsafe fn vshlq_n_u8(a: uint8x16_t, n: i32) -> uint8x16_t {
1695+
if n < 0 || n > 7 {
1696+
unreachable_unchecked();
1697+
};
16891698
uint8x16_t(
16901699
a.0 << n,
16911700
a.1 << n,

0 commit comments

Comments
 (0)