We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 124a210 commit 7b0e386Copy full SHA for 7b0e386
crates/core_arch/src/arm/neon.rs
@@ -1477,10 +1477,16 @@ macro_rules! arm_vget_lane {
1477
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
1478
#[cfg_attr(test, assert_instr(umov))]
1479
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)
+ macro_rules! call {
+ ($imm5:expr) => {
+ if ($imm5) < 0 || ($imm5) > $lanes {
+ unreachable_unchecked()
1484
+ } else {
1485
+ simd_extract(v, $imm5)
1486
+ }
1487
1488
1489
+ constify_imm5!(lane, call)
1490
}
1491
};
1492
0 commit comments