Skip to content

Commit 2505864

Browse files
Rollup merge of #142078 - sayantn:more-intrinsics, r=workingjubilee
Add SIMD funnel shift and round-to-even intrinsics This PR adds 3 new SIMD intrinsics - `simd_funnel_shl` - funnel shift left - `simd_funnel_shr` - funnel shift right - `simd_round_ties_even` (vector version of `round_ties_even_fN`) TODO (future PR): implement `simd_fsh{l,r}` in miri, cg_gcc and cg_clif (it is surprisingly hard to implement without branches, the common tricks that rotate uses doesn't work because we have 2 elements now. e.g, the `-n&31` trick used by cg_gcc to implement rotate doesn't work with this because then `fshl(a, b, 0)` will be `a | b`) [#t-compiler > More SIMD intrinsics](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/More.20SIMD.20intrinsics/with/522130286) `@rustbot` label T-compiler T-libs A-intrinsics F-core_intrinsics r? `@workingjubilee`
2 parents d049f5d + 32605d8 commit 2505864

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/intrinsics/simd.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
496496
| sym::simd_flog
497497
| sym::simd_flog10
498498
| sym::simd_flog2
499-
| sym::simd_round => {
499+
| sym::simd_round
500+
| sym::simd_round_ties_even => {
500501
intrinsic_args!(fx, args => (a); intrinsic);
501502

502503
if !a.layout().ty.is_simd() {
@@ -527,6 +528,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
527528
(sym::simd_flog2, types::F64) => "log2",
528529
(sym::simd_round, types::F32) => "roundf",
529530
(sym::simd_round, types::F64) => "round",
531+
(sym::simd_round_ties_even, types::F32) => "rintf",
532+
(sym::simd_round_ties_even, types::F64) => "rint",
530533
_ => unreachable!("{:?}", intrinsic),
531534
};
532535
fx.lib_call(

0 commit comments

Comments
 (0)