Skip to content

Commit 1d21b64

Browse files
committed
remove simd_shuffle_dyn: LLVM does not support it
1 parent e42468c commit 1d21b64

File tree

4 files changed

+1
-50
lines changed

4 files changed

+1
-50
lines changed

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,33 +1422,6 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
14221422

14231423
return Ok(bx.shuffle_vector(args[0].immediate(), args[1].immediate(), indices));
14241424
}
1425-
if name == sym::simd_shuffle_dyn {
1426-
// Make sure this is actually a SIMD vector.
1427-
let idx_ty = args[2].layout.ty;
1428-
let n: u64 = if idx_ty.is_simd()
1429-
&& matches!(idx_ty.simd_size_and_type(bx.cx.tcx).1.kind(), ty::Uint(ty::UintTy::U32))
1430-
{
1431-
idx_ty.simd_size_and_type(bx.cx.tcx).0
1432-
} else {
1433-
return_error!(InvalidMonomorphization::SimdShuffle { span, name, ty: idx_ty })
1434-
};
1435-
1436-
let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn);
1437-
require!(
1438-
out_len == n,
1439-
InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len }
1440-
);
1441-
require!(
1442-
in_elem == out_ty,
1443-
InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty }
1444-
);
1445-
1446-
return Ok(bx.shuffle_vector(
1447-
args[0].immediate(),
1448-
args[1].immediate(),
1449-
args[2].immediate(),
1450-
));
1451-
}
14521425

14531426
if name == sym::simd_insert {
14541427
require!(

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,7 @@ pub fn check_intrinsic_type(
708708
| sym::simd_reduce_xor
709709
| sym::simd_reduce_min
710710
| sym::simd_reduce_max => (2, 0, vec![param(0)], param(1)),
711-
sym::simd_shuffle | sym::simd_shuffle_dyn => {
712-
(3, 0, vec![param(0), param(0), param(1)], param(2))
713-
}
711+
sym::simd_shuffle => (3, 0, vec![param(0), param(0), param(1)], param(2)),
714712
sym::simd_shuffle_generic => (2, 1, vec![param(0), param(0)], param(1)),
715713

716714
other => {

compiler/rustc_span/src/symbol.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,6 @@ symbols! {
19261926
simd_shl,
19271927
simd_shr,
19281928
simd_shuffle,
1929-
simd_shuffle_dyn,
19301929
simd_shuffle_generic,
19311930
simd_sub,
19321931
simd_trunc,

library/core/src/intrinsics/simd.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -376,25 +376,6 @@ pub unsafe fn simd_shuffle<T, U, V>(_x: T, _y: T, _idx: U) -> V {
376376
unreachable!()
377377
}
378378

379-
/// Shuffles two vectors by const indices.
380-
///
381-
/// `T` must be a vector.
382-
///
383-
/// `U` must be a vector of `u32`s. Contrary to [`simd_shuffle`], this argument does not need to be
384-
/// const, but [`simd_shuffle`] may emit better assembly for a const vector.
385-
///
386-
/// `V` must be a vector with the same element type as `T` and the same length as `U`.
387-
///
388-
/// Returns a new vector such that element `i` is selected from `xy[idx[i]]`, where `xy`
389-
/// is the concatenation of `x` and `y`.
390-
#[rustc_intrinsic]
391-
#[rustc_intrinsic_must_be_overridden]
392-
#[rustc_nounwind]
393-
#[cfg(not(bootstrap))]
394-
pub unsafe fn simd_shuffle_dyn<T, U, V>(_x: T, _y: T, _idx: U) -> V {
395-
unreachable!()
396-
}
397-
398379
/// Reads a vector of pointers.
399380
///
400381
/// `T` must be a vector.

0 commit comments

Comments
 (0)