Skip to content

Commit ccc9c93

Browse files
authored
Rollup merge of #137595 - folkertdev:remove-simd-pow-powi, r=RalfJung
remove `simd_fpow` and `simd_fpowi` Discussed in rust-lang/rust#137555 These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic. r? `@RalfJung`
2 parents 2305c8d + 143cf8d commit ccc9c93

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

src/intrinsics/simd.rs

-58
Original file line numberDiff line numberDiff line change
@@ -460,64 +460,6 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
460460
});
461461
}
462462

463-
sym::simd_fpow => {
464-
intrinsic_args!(fx, args => (a, b); intrinsic);
465-
466-
if !a.layout().ty.is_simd() {
467-
report_simd_type_validation_error(fx, intrinsic, span, a.layout().ty);
468-
return;
469-
}
470-
471-
simd_pair_for_each_lane(fx, a, b, ret, &|fx, lane_ty, _ret_lane_ty, a_lane, b_lane| {
472-
match lane_ty.kind() {
473-
ty::Float(FloatTy::F32) => fx.lib_call(
474-
"powf",
475-
vec![AbiParam::new(types::F32), AbiParam::new(types::F32)],
476-
vec![AbiParam::new(types::F32)],
477-
&[a_lane, b_lane],
478-
)[0],
479-
ty::Float(FloatTy::F64) => fx.lib_call(
480-
"pow",
481-
vec![AbiParam::new(types::F64), AbiParam::new(types::F64)],
482-
vec![AbiParam::new(types::F64)],
483-
&[a_lane, b_lane],
484-
)[0],
485-
_ => unreachable!("{:?}", lane_ty),
486-
}
487-
});
488-
}
489-
490-
sym::simd_fpowi => {
491-
intrinsic_args!(fx, args => (a, exp); intrinsic);
492-
let exp = exp.load_scalar(fx);
493-
494-
if !a.layout().ty.is_simd() {
495-
report_simd_type_validation_error(fx, intrinsic, span, a.layout().ty);
496-
return;
497-
}
498-
499-
simd_for_each_lane(
500-
fx,
501-
a,
502-
ret,
503-
&|fx, lane_ty, _ret_lane_ty, lane| match lane_ty.kind() {
504-
ty::Float(FloatTy::F32) => fx.lib_call(
505-
"__powisf2", // compiler-builtins
506-
vec![AbiParam::new(types::F32), AbiParam::new(types::I32)],
507-
vec![AbiParam::new(types::F32)],
508-
&[lane, exp],
509-
)[0],
510-
ty::Float(FloatTy::F64) => fx.lib_call(
511-
"__powidf2", // compiler-builtins
512-
vec![AbiParam::new(types::F64), AbiParam::new(types::I32)],
513-
vec![AbiParam::new(types::F64)],
514-
&[lane, exp],
515-
)[0],
516-
_ => unreachable!("{:?}", lane_ty),
517-
},
518-
);
519-
}
520-
521463
sym::simd_fsin
522464
| sym::simd_fcos
523465
| sym::simd_fexp

0 commit comments

Comments
 (0)