From 3e61492dc5196ea5806cacd56a87db3484e2495b Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 25 Feb 2023 20:37:20 -0500 Subject: [PATCH] Add feature gate --- src/intrinsic/simd.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/intrinsic/simd.rs b/src/intrinsic/simd.rs index 5ab1f9e4300..0635ad2e0c7 100644 --- a/src/intrinsic/simd.rs +++ b/src/intrinsic/simd.rs @@ -14,6 +14,7 @@ use rustc_span::{Span, Symbol, sym}; use rustc_target::abi::Align; use crate::builder::Builder; +#[cfg(feature="master")] use crate::context::CodegenCx; pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, name: Symbol, callee_ty: Ty<'tcx>, args: &[OperandRef<'tcx, RValue<'gcc>>], ret_ty: Ty<'tcx>, llret_ty: Type<'gcc>, span: Span) -> Result, ()> { @@ -508,6 +509,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, return simd_simple_float_intrinsic(name, in_elem, in_ty, in_len, bx, span, args); } + #[cfg(feature="master")] fn vector_ty<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, elem_ty: Ty<'tcx>, vec_len: u64) -> Type<'gcc> { // FIXME: use cx.layout_of(ty).llvm_type() ? let elem_ty = match *elem_ty.kind() { @@ -519,6 +521,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, cx.type_vector(elem_ty, vec_len) } + #[cfg(feature="master")] fn gather<'a, 'gcc, 'tcx>(default: RValue<'gcc>, pointers: RValue<'gcc>, mask: RValue<'gcc>, pointer_count: usize, bx: &mut Builder<'a, 'gcc, 'tcx>, in_len: u64, underlying_ty: Ty<'tcx>, invert: bool) -> RValue<'gcc> { let vector_type = if pointer_count > 1 { @@ -563,6 +566,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, } } + #[cfg(feature="master")] if name == sym::simd_gather { // simd_gather(values: , pointers: , // mask: ) -> @@ -663,6 +667,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, return Ok(gather(args[0].immediate(), args[1].immediate(), args[2].immediate(), pointer_count, bx, in_len, underlying_ty, false)); } + #[cfg(feature="master")] if name == sym::simd_scatter { // simd_scatter(values: , pointers: , // mask: ) -> ()