Skip to content

Commit 7b0e386

Browse files
committed
Use imm5 for vget_lane - this solves vgetq_lane_u64
1 parent 124a210 commit 7b0e386

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

crates/core_arch/src/arm/neon.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,10 +1477,16 @@ macro_rules! arm_vget_lane {
14771477
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
14781478
#[cfg_attr(test, assert_instr(umov))]
14791479
pub unsafe fn $name(v: $from, lane: i32) -> $to {
1480-
if lane < 0 || lane > $lanes {
1481-
unreachable_unchecked()
1482-
}
1483-
simd_extract(v, lane as u32)
1480+
macro_rules! call {
1481+
($imm5:expr) => {
1482+
if ($imm5) < 0 || ($imm5) > $lanes {
1483+
unreachable_unchecked()
1484+
} else {
1485+
simd_extract(v, $imm5)
1486+
}
1487+
}
1488+
}
1489+
constify_imm5!(lane, call)
14841490
}
14851491
};
14861492
}

0 commit comments

Comments
 (0)