| author | bors <bors@rust-lang.org> 2026-03-03 12:09:37 UTC |
| committer | bors <bors@rust-lang.org> 2026-03-03 12:09:37 UTC |
| log | d2218f5f5ca3f502772ec4cb69fc2ee44e096512 |
| tree | 46a744d2ae051bf60f40d27ec297a490981711c6 |
| parent | 1b7d722f429f09c87b08b757d89c689c6cf7f6e7 |
| parent | d53a01c410ee093457ef670b261a9876ccf91716 |
Rollup of 6 pull requests
Successful merges:
- rust-lang/rust#153336 (stdarch subtree update)
- rust-lang/rust#152943 (Parse `impl` restrictions)
- rust-lang/rust#153184 (Replace CodegenResults with CompiledModules)
- rust-lang/rust#153285 (Update call-llvm-intrinsics test for Rust 1.94.0 IR)
- rust-lang/rust#153319 (Comments and docs: add missing periods to "ie.")
- rust-lang/rust#153326 (Make `rustc_with_all_queries!` pass query modifiers as named values)89 files changed, 2644 insertions(+), 2161 deletions(-)
compiler/rustc_ast/src/ast.rs+14| ... | @@ -3553,6 +3553,19 @@ impl VisibilityKind { | ... | @@ -3553,6 +3553,19 @@ impl VisibilityKind { |
| 3553 | } | 3553 | } |
| 3554 | } | 3554 | } |
| 3555 | 3555 | ||
| 3556 | #[derive(Clone, Encodable, Decodable, Debug, Walkable)] | ||
| 3557 | pub struct ImplRestriction { | ||
| 3558 | pub kind: RestrictionKind, | ||
| 3559 | pub span: Span, | ||
| 3560 | pub tokens: Option<LazyAttrTokenStream>, | ||
| 3561 | } | ||
| 3562 | |||
| 3563 | #[derive(Clone, Encodable, Decodable, Debug, Walkable)] | ||
| 3564 | pub enum RestrictionKind { | ||
| 3565 | Unrestricted, | ||
| 3566 | Restricted { path: Box<Path>, id: NodeId, shorthand: bool }, | ||
| 3567 | } | ||
| 3568 | |||
| 3556 | /// Field definition in a struct, variant or union. | 3569 | /// Field definition in a struct, variant or union. |
| 3557 | /// | 3570 | /// |
| 3558 | /// E.g., `bar: usize` as in `struct Foo { bar: usize }`. | 3571 | /// E.g., `bar: usize` as in `struct Foo { bar: usize }`. |
| ... | @@ -3752,6 +3765,7 @@ pub struct Trait { | ... | @@ -3752,6 +3765,7 @@ pub struct Trait { |
| 3752 | pub constness: Const, | 3765 | pub constness: Const, |
| 3753 | pub safety: Safety, | 3766 | pub safety: Safety, |
| 3754 | pub is_auto: IsAuto, | 3767 | pub is_auto: IsAuto, |
| 3768 | pub impl_restriction: ImplRestriction, | ||
| 3755 | pub ident: Ident, | 3769 | pub ident: Ident, |
| 3756 | pub generics: Generics, | 3770 | pub generics: Generics, |
| 3757 | #[visitable(extra = BoundKind::SuperTraits)] | 3771 | #[visitable(extra = BoundKind::SuperTraits)] |
compiler/rustc_ast/src/ast_traits.rs+16-4| ... | @@ -8,8 +8,8 @@ use std::marker::PhantomData; | ... | @@ -8,8 +8,8 @@ use std::marker::PhantomData; |
| 8 | use crate::tokenstream::LazyAttrTokenStream; | 8 | use crate::tokenstream::LazyAttrTokenStream; |
| 9 | use crate::{ | 9 | use crate::{ |
| 10 | Arm, AssocItem, AttrItem, AttrKind, AttrVec, Attribute, Block, Crate, Expr, ExprField, | 10 | Arm, AssocItem, AttrItem, AttrKind, AttrVec, Attribute, Block, Crate, Expr, ExprField, |
| 11 | FieldDef, ForeignItem, GenericParam, Item, NodeId, Param, Pat, PatField, Path, Stmt, StmtKind, | 11 | FieldDef, ForeignItem, GenericParam, ImplRestriction, Item, NodeId, Param, Pat, PatField, Path, |
| 12 | Ty, Variant, Visibility, WherePredicate, | 12 | Stmt, StmtKind, Ty, Variant, Visibility, WherePredicate, |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | /// A trait for AST nodes having an ID. | 15 | /// A trait for AST nodes having an ID. |
| ... | @@ -97,7 +97,19 @@ macro_rules! impl_has_tokens_none { | ... | @@ -97,7 +97,19 @@ macro_rules! impl_has_tokens_none { |
| 97 | }; | 97 | }; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | impl_has_tokens!(AssocItem, AttrItem, Block, Expr, ForeignItem, Item, Pat, Path, Ty, Visibility); | 100 | impl_has_tokens!( |
| 101 | AssocItem, | ||
| 102 | AttrItem, | ||
| 103 | Block, | ||
| 104 | Expr, | ||
| 105 | ForeignItem, | ||
| 106 | Item, | ||
| 107 | Pat, | ||
| 108 | Path, | ||
| 109 | Ty, | ||
| 110 | Visibility, | ||
| 111 | ImplRestriction | ||
| 112 | ); | ||
| 101 | impl_has_tokens_none!( | 113 | impl_has_tokens_none!( |
| 102 | Arm, | 114 | Arm, |
| 103 | ExprField, | 115 | ExprField, |
| ... | @@ -242,7 +254,7 @@ impl_has_attrs!( | ... | @@ -242,7 +254,7 @@ impl_has_attrs!( |
| 242 | Variant, | 254 | Variant, |
| 243 | WherePredicate, | 255 | WherePredicate, |
| 244 | ); | 256 | ); |
| 245 | impl_has_attrs_none!(Attribute, AttrItem, Block, Pat, Path, Ty, Visibility); | 257 | impl_has_attrs_none!(Attribute, AttrItem, Block, Pat, Path, Ty, Visibility, ImplRestriction); |
| 246 | 258 | ||
| 247 | impl<T: HasAttrs> HasAttrs for Box<T> { | 259 | impl<T: HasAttrs> HasAttrs for Box<T> { |
| 248 | const SUPPORTS_CUSTOM_INNER_ATTRS: bool = T::SUPPORTS_CUSTOM_INNER_ATTRS; | 260 | const SUPPORTS_CUSTOM_INNER_ATTRS: bool = T::SUPPORTS_CUSTOM_INNER_ATTRS; |
compiler/rustc_ast/src/visit.rs+3| ... | @@ -467,6 +467,7 @@ macro_rules! common_visitor_and_walkers { | ... | @@ -467,6 +467,7 @@ macro_rules! common_visitor_and_walkers { |
| 467 | RangeEnd, | 467 | RangeEnd, |
| 468 | RangeSyntax, | 468 | RangeSyntax, |
| 469 | Recovered, | 469 | Recovered, |
| 470 | RestrictionKind, | ||
| 470 | Safety, | 471 | Safety, |
| 471 | StaticItem, | 472 | StaticItem, |
| 472 | StrLit, | 473 | StrLit, |
| ... | @@ -595,6 +596,7 @@ macro_rules! common_visitor_and_walkers { | ... | @@ -595,6 +596,7 @@ macro_rules! common_visitor_and_walkers { |
| 595 | fn visit_poly_trait_ref(PolyTraitRef); | 596 | fn visit_poly_trait_ref(PolyTraitRef); |
| 596 | fn visit_precise_capturing_arg(PreciseCapturingArg); | 597 | fn visit_precise_capturing_arg(PreciseCapturingArg); |
| 597 | fn visit_qself(QSelf); | 598 | fn visit_qself(QSelf); |
| 599 | fn visit_impl_restriction(ImplRestriction); | ||
| 598 | fn visit_trait_ref(TraitRef); | 600 | fn visit_trait_ref(TraitRef); |
| 599 | fn visit_ty_pat(TyPat); | 601 | fn visit_ty_pat(TyPat); |
| 600 | fn visit_ty(Ty); | 602 | fn visit_ty(Ty); |
| ... | @@ -1117,6 +1119,7 @@ macro_rules! common_visitor_and_walkers { | ... | @@ -1117,6 +1119,7 @@ macro_rules! common_visitor_and_walkers { |
| 1117 | pub fn walk_poly_trait_ref(PolyTraitRef); | 1119 | pub fn walk_poly_trait_ref(PolyTraitRef); |
| 1118 | pub fn walk_precise_capturing_arg(PreciseCapturingArg); | 1120 | pub fn walk_precise_capturing_arg(PreciseCapturingArg); |
| 1119 | pub fn walk_qself(QSelf); | 1121 | pub fn walk_qself(QSelf); |
| 1122 | pub fn walk_impl_restriction(ImplRestriction); | ||
| 1120 | pub fn walk_trait_ref(TraitRef); | 1123 | pub fn walk_trait_ref(TraitRef); |
| 1121 | pub fn walk_ty_pat(TyPat); | 1124 | pub fn walk_ty_pat(TyPat); |
| 1122 | pub fn walk_ty(Ty); | 1125 | pub fn walk_ty(Ty); |
compiler/rustc_ast_lowering/src/item.rs+2| ... | @@ -512,6 +512,8 @@ impl<'hir> LoweringContext<'_, 'hir> { | ... | @@ -512,6 +512,8 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 512 | constness, | 512 | constness, |
| 513 | is_auto, | 513 | is_auto, |
| 514 | safety, | 514 | safety, |
| 515 | // FIXME(impl_restrictions): lower to HIR | ||
| 516 | impl_restriction: _, | ||
| 515 | ident, | 517 | ident, |
| 516 | generics, | 518 | generics, |
| 517 | bounds, | 519 | bounds, |
compiler/rustc_ast_passes/src/feature_gate.rs+1| ... | @@ -590,6 +590,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { | ... | @@ -590,6 +590,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { |
| 590 | gate_all!(coroutines, "coroutine syntax is experimental"); | 590 | gate_all!(coroutines, "coroutine syntax is experimental"); |
| 591 | gate_all!(const_block_items, "const block items are experimental"); | 591 | gate_all!(const_block_items, "const block items are experimental"); |
| 592 | gate_all!(final_associated_functions, "`final` on trait functions is experimental"); | 592 | gate_all!(final_associated_functions, "`final` on trait functions is experimental"); |
| 593 | gate_all!(impl_restriction, "`impl` restrictions are experimental"); | ||
| 593 | 594 | ||
| 594 | if !visitor.features.never_patterns() { | 595 | if !visitor.features.never_patterns() { |
| 595 | if let Some(spans) = spans.get(&sym::never_patterns) { | 596 | if let Some(spans) = spans.get(&sym::never_patterns) { |
compiler/rustc_ast_pretty/src/pprust/mod.rs+4| ... | @@ -80,6 +80,10 @@ pub fn vis_to_string(v: &ast::Visibility) -> String { | ... | @@ -80,6 +80,10 @@ pub fn vis_to_string(v: &ast::Visibility) -> String { |
| 80 | State::new().vis_to_string(v) | 80 | State::new().vis_to_string(v) |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | pub fn impl_restriction_to_string(r: &ast::ImplRestriction) -> String { | ||
| 84 | State::new().impl_restriction_to_string(r) | ||
| 85 | } | ||
| 86 | |||
| 83 | pub fn meta_list_item_to_string(li: &ast::MetaItemInner) -> String { | 87 | pub fn meta_list_item_to_string(li: &ast::MetaItemInner) -> String { |
| 84 | State::new().meta_list_item_to_string(li) | 88 | State::new().meta_list_item_to_string(li) |
| 85 | } | 89 | } |
compiler/rustc_ast_pretty/src/pprust/state.rs+4| ... | @@ -1110,6 +1110,10 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere | ... | @@ -1110,6 +1110,10 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere |
| 1110 | Self::to_string(|s| s.print_visibility(v)) | 1110 | Self::to_string(|s| s.print_visibility(v)) |
| 1111 | } | 1111 | } |
| 1112 | 1112 | ||
| 1113 | fn impl_restriction_to_string(&self, r: &ast::ImplRestriction) -> String { | ||
| 1114 | Self::to_string(|s| s.print_impl_restriction(r)) | ||
| 1115 | } | ||
| 1116 | |||
| 1113 | fn block_to_string(&self, blk: &ast::Block) -> String { | 1117 | fn block_to_string(&self, blk: &ast::Block) -> String { |
| 1114 | Self::to_string(|s| { | 1118 | Self::to_string(|s| { |
| 1115 | let (cb, ib) = s.head(""); | 1119 | let (cb, ib) = s.head(""); |
compiler/rustc_ast_pretty/src/pprust/state/item.rs+16| ... | @@ -365,6 +365,7 @@ impl<'a> State<'a> { | ... | @@ -365,6 +365,7 @@ impl<'a> State<'a> { |
| 365 | constness, | 365 | constness, |
| 366 | safety, | 366 | safety, |
| 367 | is_auto, | 367 | is_auto, |
| 368 | impl_restriction, | ||
| 368 | ident, | 369 | ident, |
| 369 | generics, | 370 | generics, |
| 370 | bounds, | 371 | bounds, |
| ... | @@ -375,6 +376,7 @@ impl<'a> State<'a> { | ... | @@ -375,6 +376,7 @@ impl<'a> State<'a> { |
| 375 | self.print_constness(*constness); | 376 | self.print_constness(*constness); |
| 376 | self.print_safety(*safety); | 377 | self.print_safety(*safety); |
| 377 | self.print_is_auto(*is_auto); | 378 | self.print_is_auto(*is_auto); |
| 379 | self.print_impl_restriction(impl_restriction); | ||
| 378 | self.word_nbsp("trait"); | 380 | self.word_nbsp("trait"); |
| 379 | self.print_ident(*ident); | 381 | self.print_ident(*ident); |
| 380 | self.print_generic_params(&generics.params); | 382 | self.print_generic_params(&generics.params); |
| ... | @@ -483,6 +485,20 @@ impl<'a> State<'a> { | ... | @@ -483,6 +485,20 @@ impl<'a> State<'a> { |
| 483 | } | 485 | } |
| 484 | } | 486 | } |
| 485 | 487 | ||
| 488 | pub(crate) fn print_impl_restriction(&mut self, impl_restriction: &ast::ImplRestriction) { | ||
| 489 | match &impl_restriction.kind { | ||
| 490 | ast::RestrictionKind::Restricted { path, shorthand, .. } => { | ||
| 491 | let path = Self::to_string(|s| s.print_path(path, false, 0)); | ||
| 492 | if *shorthand { | ||
| 493 | self.word_nbsp(format!("impl({path})")) | ||
| 494 | } else { | ||
| 495 | self.word_nbsp(format!("impl(in {path})")) | ||
| 496 | } | ||
| 497 | } | ||
| 498 | ast::RestrictionKind::Unrestricted => {} | ||
| 499 | } | ||
| 500 | } | ||
| 501 | |||
| 486 | fn print_defaultness(&mut self, defaultness: ast::Defaultness) { | 502 | fn print_defaultness(&mut self, defaultness: ast::Defaultness) { |
| 487 | if let ast::Defaultness::Default(_) = defaultness { | 503 | if let ast::Defaultness::Default(_) = defaultness { |
| 488 | self.word_nbsp("default"); | 504 | self.word_nbsp("default"); |
compiler/rustc_codegen_cranelift/src/driver/aot.rs+4-21| ... | @@ -10,9 +10,9 @@ use std::thread::JoinHandle; | ... | @@ -10,9 +10,9 @@ use std::thread::JoinHandle; |
| 10 | 10 | ||
| 11 | use cranelift_object::{ObjectBuilder, ObjectModule}; | 11 | use cranelift_object::{ObjectBuilder, ObjectModule}; |
| 12 | use rustc_codegen_ssa::assert_module_sources::CguReuse; | 12 | use rustc_codegen_ssa::assert_module_sources::CguReuse; |
| 13 | use rustc_codegen_ssa::back::write::{CompiledModules, produce_final_output_artifacts}; | 13 | use rustc_codegen_ssa::back::write::produce_final_output_artifacts; |
| 14 | use rustc_codegen_ssa::base::determine_cgu_reuse; | 14 | use rustc_codegen_ssa::base::determine_cgu_reuse; |
| 15 | use rustc_codegen_ssa::{CodegenResults, CompiledModule, CrateInfo, ModuleKind}; | 15 | use rustc_codegen_ssa::{CompiledModule, CompiledModules, ModuleKind}; |
| 16 | use rustc_data_structures::profiling::SelfProfilerRef; | 16 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 17 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; | 17 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 18 | use rustc_data_structures::sync::{IntoDynSyncSend, par_map}; | 18 | use rustc_data_structures::sync::{IntoDynSyncSend, par_map}; |
| ... | @@ -54,7 +54,6 @@ impl<HCX> HashStable<HCX> for OngoingModuleCodegen { | ... | @@ -54,7 +54,6 @@ impl<HCX> HashStable<HCX> for OngoingModuleCodegen { |
| 54 | pub(crate) struct OngoingCodegen { | 54 | pub(crate) struct OngoingCodegen { |
| 55 | modules: Vec<OngoingModuleCodegen>, | 55 | modules: Vec<OngoingModuleCodegen>, |
| 56 | allocator_module: Option<CompiledModule>, | 56 | allocator_module: Option<CompiledModule>, |
| 57 | crate_info: CrateInfo, | ||
| 58 | concurrency_limiter: ConcurrencyLimiter, | 57 | concurrency_limiter: ConcurrencyLimiter, |
| 59 | } | 58 | } |
| 60 | 59 | ||
| ... | @@ -63,7 +62,7 @@ impl OngoingCodegen { | ... | @@ -63,7 +62,7 @@ impl OngoingCodegen { |
| 63 | self, | 62 | self, |
| 64 | sess: &Session, | 63 | sess: &Session, |
| 65 | outputs: &OutputFilenames, | 64 | outputs: &OutputFilenames, |
| 66 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 65 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 67 | let mut work_products = FxIndexMap::default(); | 66 | let mut work_products = FxIndexMap::default(); |
| 68 | let mut modules = vec![]; | 67 | let mut modules = vec![]; |
| 69 | let disable_incr_cache = disable_incr_cache(); | 68 | let disable_incr_cache = disable_incr_cache(); |
| ... | @@ -126,15 +125,7 @@ impl OngoingCodegen { | ... | @@ -126,15 +125,7 @@ impl OngoingCodegen { |
| 126 | 125 | ||
| 127 | produce_final_output_artifacts(sess, &compiled_modules, outputs); | 126 | produce_final_output_artifacts(sess, &compiled_modules, outputs); |
| 128 | 127 | ||
| 129 | ( | 128 | (compiled_modules, work_products) |
| 130 | CodegenResults { | ||
| 131 | crate_info: self.crate_info, | ||
| 132 | |||
| 133 | modules: compiled_modules.modules, | ||
| 134 | allocator_module: compiled_modules.allocator_module, | ||
| 135 | }, | ||
| 136 | work_products, | ||
| 137 | ) | ||
| 138 | } | 129 | } |
| 139 | } | 130 | } |
| 140 | 131 | ||
| ... | @@ -483,13 +474,6 @@ fn emit_allocator_module(tcx: TyCtxt<'_>) -> Option<CompiledModule> { | ... | @@ -483,13 +474,6 @@ fn emit_allocator_module(tcx: TyCtxt<'_>) -> Option<CompiledModule> { |
| 483 | } | 474 | } |
| 484 | 475 | ||
| 485 | pub(crate) fn run_aot(tcx: TyCtxt<'_>) -> Box<OngoingCodegen> { | 476 | pub(crate) fn run_aot(tcx: TyCtxt<'_>) -> Box<OngoingCodegen> { |
| 486 | // FIXME handle `-Ctarget-cpu=native` | ||
| 487 | let target_cpu = match tcx.sess.opts.cg.target_cpu { | ||
| 488 | Some(ref name) => name, | ||
| 489 | None => tcx.sess.target.cpu.as_ref(), | ||
| 490 | } | ||
| 491 | .to_owned(); | ||
| 492 | |||
| 493 | let cgus = tcx.collect_and_partition_mono_items(()).codegen_units; | 477 | let cgus = tcx.collect_and_partition_mono_items(()).codegen_units; |
| 494 | 478 | ||
| 495 | if tcx.dep_graph.is_fully_enabled() { | 479 | if tcx.dep_graph.is_fully_enabled() { |
| ... | @@ -549,7 +533,6 @@ pub(crate) fn run_aot(tcx: TyCtxt<'_>) -> Box<OngoingCodegen> { | ... | @@ -549,7 +533,6 @@ pub(crate) fn run_aot(tcx: TyCtxt<'_>) -> Box<OngoingCodegen> { |
| 549 | Box::new(OngoingCodegen { | 533 | Box::new(OngoingCodegen { |
| 550 | modules, | 534 | modules, |
| 551 | allocator_module, | 535 | allocator_module, |
| 552 | crate_info: CrateInfo::new(tcx, target_cpu), | ||
| 553 | concurrency_limiter: concurrency_limiter.0, | 536 | concurrency_limiter: concurrency_limiter.0, |
| 554 | }) | 537 | }) |
| 555 | } | 538 | } |
compiler/rustc_codegen_cranelift/src/driver/jit.rs+7-6| ... | @@ -16,13 +16,14 @@ use crate::debuginfo::TypeDebugContext; | ... | @@ -16,13 +16,14 @@ use crate::debuginfo::TypeDebugContext; |
| 16 | use crate::prelude::*; | 16 | use crate::prelude::*; |
| 17 | use crate::unwind_module::UnwindModule; | 17 | use crate::unwind_module::UnwindModule; |
| 18 | 18 | ||
| 19 | fn create_jit_module(tcx: TyCtxt<'_>) -> (UnwindModule<JITModule>, Option<DebugContext>) { | 19 | fn create_jit_module( |
| 20 | let crate_info = CrateInfo::new(tcx, "dummy_target_cpu".to_string()); | 20 | tcx: TyCtxt<'_>, |
| 21 | 21 | crate_info: &CrateInfo, | |
| 22 | ) -> (UnwindModule<JITModule>, Option<DebugContext>) { | ||
| 22 | let isa = crate::build_isa(tcx.sess, true); | 23 | let isa = crate::build_isa(tcx.sess, true); |
| 23 | let mut jit_builder = JITBuilder::with_isa(isa, cranelift_module::default_libcall_names()); | 24 | let mut jit_builder = JITBuilder::with_isa(isa, cranelift_module::default_libcall_names()); |
| 24 | crate::compiler_builtins::register_functions_for_jit(&mut jit_builder); | 25 | crate::compiler_builtins::register_functions_for_jit(&mut jit_builder); |
| 25 | jit_builder.symbol_lookup_fn(dep_symbol_lookup_fn(tcx.sess, crate_info)); | 26 | jit_builder.symbol_lookup_fn(dep_symbol_lookup_fn(tcx.sess, crate_info.clone())); |
| 26 | let mut jit_module = UnwindModule::new(JITModule::new(jit_builder), false); | 27 | let mut jit_module = UnwindModule::new(JITModule::new(jit_builder), false); |
| 27 | 28 | ||
| 28 | let cx = DebugContext::new(tcx, jit_module.isa(), false, "dummy_cgu_name"); | 29 | let cx = DebugContext::new(tcx, jit_module.isa(), false, "dummy_cgu_name"); |
| ... | @@ -32,14 +33,14 @@ fn create_jit_module(tcx: TyCtxt<'_>) -> (UnwindModule<JITModule>, Option<DebugC | ... | @@ -32,14 +33,14 @@ fn create_jit_module(tcx: TyCtxt<'_>) -> (UnwindModule<JITModule>, Option<DebugC |
| 32 | (jit_module, cx) | 33 | (jit_module, cx) |
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | pub(crate) fn run_jit(tcx: TyCtxt<'_>, jit_args: Vec<String>) -> ! { | 36 | pub(crate) fn run_jit(tcx: TyCtxt<'_>, crate_info: &CrateInfo, jit_args: Vec<String>) -> ! { |
| 36 | if !tcx.crate_types().contains(&rustc_session::config::CrateType::Executable) { | 37 | if !tcx.crate_types().contains(&rustc_session::config::CrateType::Executable) { |
| 37 | tcx.dcx().fatal("can't jit non-executable crate"); | 38 | tcx.dcx().fatal("can't jit non-executable crate"); |
| 38 | } | 39 | } |
| 39 | 40 | ||
| 40 | let output_filenames = tcx.output_filenames(()); | 41 | let output_filenames = tcx.output_filenames(()); |
| 41 | let should_write_ir = crate::pretty_clif::should_write_ir(tcx.sess); | 42 | let should_write_ir = crate::pretty_clif::should_write_ir(tcx.sess); |
| 42 | let (mut jit_module, mut debug_context) = create_jit_module(tcx); | 43 | let (mut jit_module, mut debug_context) = create_jit_module(tcx, crate_info); |
| 43 | let mut cached_context = Context::new(); | 44 | let mut cached_context = Context::new(); |
| 44 | 45 | ||
| 45 | let cgus = tcx.collect_and_partition_mono_items(()).codegen_units; | 46 | let cgus = tcx.collect_and_partition_mono_items(()).codegen_units; |
compiler/rustc_codegen_cranelift/src/lib.rs+13-4| ... | @@ -40,7 +40,7 @@ use std::sync::Arc; | ... | @@ -40,7 +40,7 @@ use std::sync::Arc; |
| 40 | use cranelift_codegen::isa::TargetIsa; | 40 | use cranelift_codegen::isa::TargetIsa; |
| 41 | use cranelift_codegen::settings::{self, Configurable}; | 41 | use cranelift_codegen::settings::{self, Configurable}; |
| 42 | use rustc_codegen_ssa::traits::CodegenBackend; | 42 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 43 | use rustc_codegen_ssa::{CodegenResults, TargetConfig}; | 43 | use rustc_codegen_ssa::{CompiledModules, CrateInfo, TargetConfig}; |
| 44 | use rustc_log::tracing::info; | 44 | use rustc_log::tracing::info; |
| 45 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; | 45 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 46 | use rustc_session::Session; | 46 | use rustc_session::Session; |
| ... | @@ -200,12 +200,21 @@ impl CodegenBackend for CraneliftCodegenBackend { | ... | @@ -200,12 +200,21 @@ impl CodegenBackend for CraneliftCodegenBackend { |
| 200 | println!("Cranelift version: {}", cranelift_codegen::VERSION); | 200 | println!("Cranelift version: {}", cranelift_codegen::VERSION); |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> { | 203 | fn target_cpu(&self, sess: &Session) -> String { |
| 204 | // FIXME handle `-Ctarget-cpu=native` | ||
| 205 | match sess.opts.cg.target_cpu { | ||
| 206 | Some(ref name) => name, | ||
| 207 | None => sess.target.cpu.as_ref(), | ||
| 208 | } | ||
| 209 | .to_owned() | ||
| 210 | } | ||
| 211 | |||
| 212 | fn codegen_crate(&self, tcx: TyCtxt<'_>, _crate_info: &CrateInfo) -> Box<dyn Any> { | ||
| 204 | info!("codegen crate {}", tcx.crate_name(LOCAL_CRATE)); | 213 | info!("codegen crate {}", tcx.crate_name(LOCAL_CRATE)); |
| 205 | let config = self.config.get().unwrap(); | 214 | let config = self.config.get().unwrap(); |
| 206 | if config.jit_mode { | 215 | if config.jit_mode { |
| 207 | #[cfg(feature = "jit")] | 216 | #[cfg(feature = "jit")] |
| 208 | driver::jit::run_jit(tcx, config.jit_args.clone()); | 217 | driver::jit::run_jit(tcx, _crate_info, config.jit_args.clone()); |
| 209 | 218 | ||
| 210 | #[cfg(not(feature = "jit"))] | 219 | #[cfg(not(feature = "jit"))] |
| 211 | tcx.dcx().fatal("jit support was disabled when compiling rustc_codegen_cranelift"); | 220 | tcx.dcx().fatal("jit support was disabled when compiling rustc_codegen_cranelift"); |
| ... | @@ -219,7 +228,7 @@ impl CodegenBackend for CraneliftCodegenBackend { | ... | @@ -219,7 +228,7 @@ impl CodegenBackend for CraneliftCodegenBackend { |
| 219 | ongoing_codegen: Box<dyn Any>, | 228 | ongoing_codegen: Box<dyn Any>, |
| 220 | sess: &Session, | 229 | sess: &Session, |
| 221 | outputs: &OutputFilenames, | 230 | outputs: &OutputFilenames, |
| 222 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 231 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 223 | ongoing_codegen.downcast::<driver::aot::OngoingCodegen>().unwrap().join(sess, outputs) | 232 | ongoing_codegen.downcast::<driver::aot::OngoingCodegen>().unwrap().join(sess, outputs) |
| 224 | } | 233 | } |
| 225 | } | 234 | } |
compiler/rustc_codegen_gcc/src/lib.rs+7-6| ... | @@ -88,7 +88,7 @@ use rustc_codegen_ssa::back::write::{ | ... | @@ -88,7 +88,7 @@ use rustc_codegen_ssa::back::write::{ |
| 88 | use rustc_codegen_ssa::base::codegen_crate; | 88 | use rustc_codegen_ssa::base::codegen_crate; |
| 89 | use rustc_codegen_ssa::target_features::cfg_target_feature; | 89 | use rustc_codegen_ssa::target_features::cfg_target_feature; |
| 90 | use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, WriteBackendMethods}; | 90 | use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, WriteBackendMethods}; |
| 91 | use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, TargetConfig}; | 91 | use rustc_codegen_ssa::{CompiledModule, CompiledModules, CrateInfo, ModuleCodegen, TargetConfig}; |
| 92 | use rustc_data_structures::fx::FxIndexMap; | 92 | use rustc_data_structures::fx::FxIndexMap; |
| 93 | use rustc_data_structures::profiling::SelfProfilerRef; | 93 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 94 | use rustc_data_structures::sync::IntoDynSyncSend; | 94 | use rustc_data_structures::sync::IntoDynSyncSend; |
| ... | @@ -287,11 +287,12 @@ impl CodegenBackend for GccCodegenBackend { | ... | @@ -287,11 +287,12 @@ impl CodegenBackend for GccCodegenBackend { |
| 287 | |tcx, ()| gcc_util::global_gcc_features(tcx.sess) | 287 | |tcx, ()| gcc_util::global_gcc_features(tcx.sess) |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> { | 290 | fn target_cpu(&self, sess: &Session) -> String { |
| 291 | let target_cpu = target_cpu(tcx.sess); | 291 | target_cpu(sess).to_owned() |
| 292 | let res = codegen_crate(self.clone(), tcx, target_cpu.to_string()); | 292 | } |
| 293 | 293 | ||
| 294 | Box::new(res) | 294 | fn codegen_crate(&self, tcx: TyCtxt<'_>, crate_info: &CrateInfo) -> Box<dyn Any> { |
| 295 | Box::new(codegen_crate(self.clone(), tcx, crate_info)) | ||
| 295 | } | 296 | } |
| 296 | 297 | ||
| 297 | fn join_codegen( | 298 | fn join_codegen( |
| ... | @@ -299,7 +300,7 @@ impl CodegenBackend for GccCodegenBackend { | ... | @@ -299,7 +300,7 @@ impl CodegenBackend for GccCodegenBackend { |
| 299 | ongoing_codegen: Box<dyn Any>, | 300 | ongoing_codegen: Box<dyn Any>, |
| 300 | sess: &Session, | 301 | sess: &Session, |
| 301 | _outputs: &OutputFilenames, | 302 | _outputs: &OutputFilenames, |
| 302 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 303 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 303 | ongoing_codegen | 304 | ongoing_codegen |
| 304 | .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>() | 305 | .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>() |
| 305 | .expect("Expected GccCodegenBackend's OngoingCodegen, found Box<Any>") | 306 | .expect("Expected GccCodegenBackend's OngoingCodegen, found Box<Any>") |
compiler/rustc_codegen_llvm/src/lib.rs+14-12| ... | @@ -33,7 +33,7 @@ use rustc_codegen_ssa::back::write::{ | ... | @@ -33,7 +33,7 @@ use rustc_codegen_ssa::back::write::{ |
| 33 | TargetMachineFactoryFn, | 33 | TargetMachineFactoryFn, |
| 34 | }; | 34 | }; |
| 35 | use rustc_codegen_ssa::traits::*; | 35 | use rustc_codegen_ssa::traits::*; |
| 36 | use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, TargetConfig}; | 36 | use rustc_codegen_ssa::{CompiledModule, CompiledModules, CrateInfo, ModuleCodegen, TargetConfig}; |
| 37 | use rustc_data_structures::fx::FxIndexMap; | 37 | use rustc_data_structures::fx::FxIndexMap; |
| 38 | use rustc_data_structures::profiling::SelfProfilerRef; | 38 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 39 | use rustc_errors::{DiagCtxt, DiagCtxtHandle}; | 39 | use rustc_errors::{DiagCtxt, DiagCtxtHandle}; |
| ... | @@ -360,12 +360,12 @@ impl CodegenBackend for LlvmCodegenBackend { | ... | @@ -360,12 +360,12 @@ impl CodegenBackend for LlvmCodegenBackend { |
| 360 | will_not_use_fallback | 360 | will_not_use_fallback |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Box<dyn Any> { | 363 | fn target_cpu(&self, sess: &Session) -> String { |
| 364 | Box::new(rustc_codegen_ssa::base::codegen_crate( | 364 | crate::llvm_util::target_cpu(sess).to_string() |
| 365 | LlvmCodegenBackend(()), | 365 | } |
| 366 | tcx, | 366 | |
| 367 | crate::llvm_util::target_cpu(tcx.sess).to_string(), | 367 | fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>, crate_info: &CrateInfo) -> Box<dyn Any> { |
| 368 | )) | 368 | Box::new(rustc_codegen_ssa::base::codegen_crate(LlvmCodegenBackend(()), tcx, crate_info)) |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | fn join_codegen( | 371 | fn join_codegen( |
| ... | @@ -373,8 +373,8 @@ impl CodegenBackend for LlvmCodegenBackend { | ... | @@ -373,8 +373,8 @@ impl CodegenBackend for LlvmCodegenBackend { |
| 373 | ongoing_codegen: Box<dyn Any>, | 373 | ongoing_codegen: Box<dyn Any>, |
| 374 | sess: &Session, | 374 | sess: &Session, |
| 375 | outputs: &OutputFilenames, | 375 | outputs: &OutputFilenames, |
| 376 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 376 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 377 | let (codegen_results, work_products) = ongoing_codegen | 377 | let (compiled_modules, work_products) = ongoing_codegen |
| 378 | .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<LlvmCodegenBackend>>() | 378 | .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<LlvmCodegenBackend>>() |
| 379 | .expect("Expected LlvmCodegenBackend's OngoingCodegen, found Box<Any>") | 379 | .expect("Expected LlvmCodegenBackend's OngoingCodegen, found Box<Any>") |
| 380 | .join(sess); | 380 | .join(sess); |
| ... | @@ -386,13 +386,14 @@ impl CodegenBackend for LlvmCodegenBackend { | ... | @@ -386,13 +386,14 @@ impl CodegenBackend for LlvmCodegenBackend { |
| 386 | }); | 386 | }); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | (codegen_results, work_products) | 389 | (compiled_modules, work_products) |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | fn link( | 392 | fn link( |
| 393 | &self, | 393 | &self, |
| 394 | sess: &Session, | 394 | sess: &Session, |
| 395 | codegen_results: CodegenResults, | 395 | compiled_modules: CompiledModules, |
| 396 | crate_info: CrateInfo, | ||
| 396 | metadata: EncodedMetadata, | 397 | metadata: EncodedMetadata, |
| 397 | outputs: &OutputFilenames, | 398 | outputs: &OutputFilenames, |
| 398 | ) { | 399 | ) { |
| ... | @@ -405,7 +406,8 @@ impl CodegenBackend for LlvmCodegenBackend { | ... | @@ -405,7 +406,8 @@ impl CodegenBackend for LlvmCodegenBackend { |
| 405 | link_binary( | 406 | link_binary( |
| 406 | sess, | 407 | sess, |
| 407 | &LlvmArchiveBuilderBuilder, | 408 | &LlvmArchiveBuilderBuilder, |
| 408 | codegen_results, | 409 | compiled_modules, |
| 410 | crate_info, | ||
| 409 | metadata, | 411 | metadata, |
| 410 | outputs, | 412 | outputs, |
| 411 | self.name(), | 413 | self.name(), |
compiler/rustc_codegen_ssa/src/back/link.rs+151-157| ... | @@ -60,7 +60,7 @@ use super::rpath::{self, RPathConfig}; | ... | @@ -60,7 +60,7 @@ use super::rpath::{self, RPathConfig}; |
| 60 | use super::{apple, versioned_llvm_target}; | 60 | use super::{apple, versioned_llvm_target}; |
| 61 | use crate::base::needs_allocator_shim_for_linking; | 61 | use crate::base::needs_allocator_shim_for_linking; |
| 62 | use crate::{ | 62 | use crate::{ |
| 63 | CodegenResults, CompiledModule, CrateInfo, NativeLib, errors, looks_like_rust_object_file, | 63 | CompiledModule, CompiledModules, CrateInfo, NativeLib, errors, looks_like_rust_object_file, |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) { | 66 | pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) { |
| ... | @@ -76,7 +76,8 @@ pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) { | ... | @@ -76,7 +76,8 @@ pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) { |
| 76 | pub fn link_binary( | 76 | pub fn link_binary( |
| 77 | sess: &Session, | 77 | sess: &Session, |
| 78 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 78 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 79 | codegen_results: CodegenResults, | 79 | compiled_modules: CompiledModules, |
| 80 | crate_info: CrateInfo, | ||
| 80 | metadata: EncodedMetadata, | 81 | metadata: EncodedMetadata, |
| 81 | outputs: &OutputFilenames, | 82 | outputs: &OutputFilenames, |
| 82 | codegen_backend: &'static str, | 83 | codegen_backend: &'static str, |
| ... | @@ -84,7 +85,7 @@ pub fn link_binary( | ... | @@ -84,7 +85,7 @@ pub fn link_binary( |
| 84 | let _timer = sess.timer("link_binary"); | 85 | let _timer = sess.timer("link_binary"); |
| 85 | let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata); | 86 | let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata); |
| 86 | let mut tempfiles_for_stdout_output: Vec<PathBuf> = Vec::new(); | 87 | let mut tempfiles_for_stdout_output: Vec<PathBuf> = Vec::new(); |
| 87 | for &crate_type in &codegen_results.crate_info.crate_types { | 88 | for &crate_type in &crate_info.crate_types { |
| 88 | // Ignore executable crates if we have -Z no-codegen, as they will error. | 89 | // Ignore executable crates if we have -Z no-codegen, as they will error. |
| 89 | if (sess.opts.unstable_opts.no_codegen || !sess.opts.output_types.should_codegen()) | 90 | if (sess.opts.unstable_opts.no_codegen || !sess.opts.output_types.should_codegen()) |
| 90 | && !output_metadata | 91 | && !output_metadata |
| ... | @@ -98,25 +99,20 @@ pub fn link_binary( | ... | @@ -98,25 +99,20 @@ pub fn link_binary( |
| 98 | } | 99 | } |
| 99 | 100 | ||
| 100 | sess.time("link_binary_check_files_are_writeable", || { | 101 | sess.time("link_binary_check_files_are_writeable", || { |
| 101 | for obj in codegen_results.modules.iter().filter_map(|m| m.object.as_ref()) { | 102 | for obj in compiled_modules.modules.iter().filter_map(|m| m.object.as_ref()) { |
| 102 | check_file_is_writeable(obj, sess); | 103 | check_file_is_writeable(obj, sess); |
| 103 | } | 104 | } |
| 104 | }); | 105 | }); |
| 105 | 106 | ||
| 106 | if outputs.outputs.should_link() { | 107 | if outputs.outputs.should_link() { |
| 107 | let output = out_filename( | 108 | let output = out_filename(sess, crate_type, outputs, crate_info.local_crate_name); |
| 108 | sess, | ||
| 109 | crate_type, | ||
| 110 | outputs, | ||
| 111 | codegen_results.crate_info.local_crate_name, | ||
| 112 | ); | ||
| 113 | let tmpdir = TempDirBuilder::new() | 109 | let tmpdir = TempDirBuilder::new() |
| 114 | .prefix("rustc") | 110 | .prefix("rustc") |
| 115 | .tempdir_in(output.parent().unwrap_or_else(|| Path::new("."))) | 111 | .tempdir_in(output.parent().unwrap_or_else(|| Path::new("."))) |
| 116 | .unwrap_or_else(|error| sess.dcx().emit_fatal(errors::CreateTempDir { error })); | 112 | .unwrap_or_else(|error| sess.dcx().emit_fatal(errors::CreateTempDir { error })); |
| 117 | let path = MaybeTempDir::new(tmpdir, sess.opts.cg.save_temps); | 113 | let path = MaybeTempDir::new(tmpdir, sess.opts.cg.save_temps); |
| 118 | 114 | ||
| 119 | let crate_name = format!("{}", codegen_results.crate_info.local_crate_name); | 115 | let crate_name = format!("{}", crate_info.local_crate_name); |
| 120 | let out_filename = output.file_for_writing( | 116 | let out_filename = output.file_for_writing( |
| 121 | outputs, | 117 | outputs, |
| 122 | OutputType::Exe, | 118 | OutputType::Exe, |
| ... | @@ -130,7 +126,8 @@ pub fn link_binary( | ... | @@ -130,7 +126,8 @@ pub fn link_binary( |
| 130 | link_rlib( | 126 | link_rlib( |
| 131 | sess, | 127 | sess, |
| 132 | archive_builder_builder, | 128 | archive_builder_builder, |
| 133 | &codegen_results, | 129 | &compiled_modules, |
| 130 | &crate_info, | ||
| 134 | &metadata, | 131 | &metadata, |
| 135 | RlibFlavor::Normal, | 132 | RlibFlavor::Normal, |
| 136 | &path, | 133 | &path, |
| ... | @@ -141,7 +138,8 @@ pub fn link_binary( | ... | @@ -141,7 +138,8 @@ pub fn link_binary( |
| 141 | link_staticlib( | 138 | link_staticlib( |
| 142 | sess, | 139 | sess, |
| 143 | archive_builder_builder, | 140 | archive_builder_builder, |
| 144 | &codegen_results, | 141 | &compiled_modules, |
| 142 | &crate_info, | ||
| 145 | &metadata, | 143 | &metadata, |
| 146 | &out_filename, | 144 | &out_filename, |
| 147 | &path, | 145 | &path, |
| ... | @@ -153,7 +151,8 @@ pub fn link_binary( | ... | @@ -153,7 +151,8 @@ pub fn link_binary( |
| 153 | archive_builder_builder, | 151 | archive_builder_builder, |
| 154 | crate_type, | 152 | crate_type, |
| 155 | &out_filename, | 153 | &out_filename, |
| 156 | &codegen_results, | 154 | &compiled_modules, |
| 155 | &crate_info, | ||
| 157 | &metadata, | 156 | &metadata, |
| 158 | path.as_ref(), | 157 | path.as_ref(), |
| 159 | codegen_backend, | 158 | codegen_backend, |
| ... | @@ -218,7 +217,7 @@ pub fn link_binary( | ... | @@ -218,7 +217,7 @@ pub fn link_binary( |
| 218 | |module: &CompiledModule| maybe_remove_temps_from_module(false, false, module); | 217 | |module: &CompiledModule| maybe_remove_temps_from_module(false, false, module); |
| 219 | 218 | ||
| 220 | // Otherwise, always remove the allocator module temporaries. | 219 | // Otherwise, always remove the allocator module temporaries. |
| 221 | if let Some(ref allocator_module) = codegen_results.allocator_module { | 220 | if let Some(ref allocator_module) = compiled_modules.allocator_module { |
| 222 | remove_temps_from_module(allocator_module); | 221 | remove_temps_from_module(allocator_module); |
| 223 | } | 222 | } |
| 224 | 223 | ||
| ... | @@ -237,7 +236,7 @@ pub fn link_binary( | ... | @@ -237,7 +236,7 @@ pub fn link_binary( |
| 237 | let (preserve_objects, preserve_dwarf_objects) = preserve_objects_for_their_debuginfo(sess); | 236 | let (preserve_objects, preserve_dwarf_objects) = preserve_objects_for_their_debuginfo(sess); |
| 238 | debug!(?preserve_objects, ?preserve_dwarf_objects); | 237 | debug!(?preserve_objects, ?preserve_dwarf_objects); |
| 239 | 238 | ||
| 240 | for module in &codegen_results.modules { | 239 | for module in &compiled_modules.modules { |
| 241 | maybe_remove_temps_from_module(preserve_objects, preserve_dwarf_objects, module); | 240 | maybe_remove_temps_from_module(preserve_objects, preserve_dwarf_objects, module); |
| 242 | } | 241 | } |
| 243 | }); | 242 | }); |
| ... | @@ -298,7 +297,8 @@ pub fn each_linked_rlib( | ... | @@ -298,7 +297,8 @@ pub fn each_linked_rlib( |
| 298 | fn link_rlib<'a>( | 297 | fn link_rlib<'a>( |
| 299 | sess: &'a Session, | 298 | sess: &'a Session, |
| 300 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 299 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 301 | codegen_results: &CodegenResults, | 300 | compiled_modules: &CompiledModules, |
| 301 | crate_info: &CrateInfo, | ||
| 302 | metadata: &EncodedMetadata, | 302 | metadata: &EncodedMetadata, |
| 303 | flavor: RlibFlavor, | 303 | flavor: RlibFlavor, |
| 304 | tmpdir: &MaybeTempDir, | 304 | tmpdir: &MaybeTempDir, |
| ... | @@ -327,7 +327,7 @@ fn link_rlib<'a>( | ... | @@ -327,7 +327,7 @@ fn link_rlib<'a>( |
| 327 | RlibFlavor::StaticlibBase => None, | 327 | RlibFlavor::StaticlibBase => None, |
| 328 | }; | 328 | }; |
| 329 | 329 | ||
| 330 | for m in &codegen_results.modules { | 330 | for m in &compiled_modules.modules { |
| 331 | if let Some(obj) = m.object.as_ref() { | 331 | if let Some(obj) = m.object.as_ref() { |
| 332 | ab.add_file(obj); | 332 | ab.add_file(obj); |
| 333 | } | 333 | } |
| ... | @@ -340,7 +340,7 @@ fn link_rlib<'a>( | ... | @@ -340,7 +340,7 @@ fn link_rlib<'a>( |
| 340 | match flavor { | 340 | match flavor { |
| 341 | RlibFlavor::Normal => {} | 341 | RlibFlavor::Normal => {} |
| 342 | RlibFlavor::StaticlibBase => { | 342 | RlibFlavor::StaticlibBase => { |
| 343 | let obj = codegen_results.allocator_module.as_ref().and_then(|m| m.object.as_ref()); | 343 | let obj = compiled_modules.allocator_module.as_ref().and_then(|m| m.object.as_ref()); |
| 344 | if let Some(obj) = obj { | 344 | if let Some(obj) = obj { |
| 345 | ab.add_file(obj); | 345 | ab.add_file(obj); |
| 346 | } | 346 | } |
| ... | @@ -366,7 +366,7 @@ fn link_rlib<'a>( | ... | @@ -366,7 +366,7 @@ fn link_rlib<'a>( |
| 366 | // feature then we'll need to figure out how to record what objects were | 366 | // feature then we'll need to figure out how to record what objects were |
| 367 | // loaded from the libraries found here and then encode that into the | 367 | // loaded from the libraries found here and then encode that into the |
| 368 | // metadata of the rlib we're generating somehow. | 368 | // metadata of the rlib we're generating somehow. |
| 369 | for lib in codegen_results.crate_info.used_libraries.iter() { | 369 | for lib in crate_info.used_libraries.iter() { |
| 370 | let NativeLibKind::Static { bundle: None | Some(true), .. } = lib.kind else { | 370 | let NativeLibKind::Static { bundle: None | Some(true), .. } = lib.kind else { |
| 371 | continue; | 371 | continue; |
| 372 | }; | 372 | }; |
| ... | @@ -394,7 +394,7 @@ fn link_rlib<'a>( | ... | @@ -394,7 +394,7 @@ fn link_rlib<'a>( |
| 394 | for output_path in raw_dylib::create_raw_dylib_dll_import_libs( | 394 | for output_path in raw_dylib::create_raw_dylib_dll_import_libs( |
| 395 | sess, | 395 | sess, |
| 396 | archive_builder_builder, | 396 | archive_builder_builder, |
| 397 | codegen_results.crate_info.used_libraries.iter(), | 397 | crate_info.used_libraries.iter(), |
| 398 | tmpdir.as_ref(), | 398 | tmpdir.as_ref(), |
| 399 | true, | 399 | true, |
| 400 | ) { | 400 | ) { |
| ... | @@ -457,7 +457,8 @@ fn link_rlib<'a>( | ... | @@ -457,7 +457,8 @@ fn link_rlib<'a>( |
| 457 | fn link_staticlib( | 457 | fn link_staticlib( |
| 458 | sess: &Session, | 458 | sess: &Session, |
| 459 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 459 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 460 | codegen_results: &CodegenResults, | 460 | compiled_modules: &CompiledModules, |
| 461 | crate_info: &CrateInfo, | ||
| 461 | metadata: &EncodedMetadata, | 462 | metadata: &EncodedMetadata, |
| 462 | out_filename: &Path, | 463 | out_filename: &Path, |
| 463 | tempdir: &MaybeTempDir, | 464 | tempdir: &MaybeTempDir, |
| ... | @@ -466,72 +467,67 @@ fn link_staticlib( | ... | @@ -466,72 +467,67 @@ fn link_staticlib( |
| 466 | let mut ab = link_rlib( | 467 | let mut ab = link_rlib( |
| 467 | sess, | 468 | sess, |
| 468 | archive_builder_builder, | 469 | archive_builder_builder, |
| 469 | codegen_results, | 470 | compiled_modules, |
| 471 | crate_info, | ||
| 470 | metadata, | 472 | metadata, |
| 471 | RlibFlavor::StaticlibBase, | 473 | RlibFlavor::StaticlibBase, |
| 472 | tempdir, | 474 | tempdir, |
| 473 | ); | 475 | ); |
| 474 | let mut all_native_libs = vec![]; | 476 | let mut all_native_libs = vec![]; |
| 475 | 477 | ||
| 476 | let res = each_linked_rlib( | 478 | let res = each_linked_rlib(crate_info, Some(CrateType::StaticLib), &mut |cnum, path| { |
| 477 | &codegen_results.crate_info, | 479 | let lto = are_upstream_rust_objects_already_included(sess) |
| 478 | Some(CrateType::StaticLib), | 480 | && !ignored_for_lto(sess, crate_info, cnum); |
| 479 | &mut |cnum, path| { | ||
| 480 | let lto = are_upstream_rust_objects_already_included(sess) | ||
| 481 | && !ignored_for_lto(sess, &codegen_results.crate_info, cnum); | ||
| 482 | |||
| 483 | let native_libs = codegen_results.crate_info.native_libraries[&cnum].iter(); | ||
| 484 | let relevant = native_libs.clone().filter(|lib| relevant_lib(sess, lib)); | ||
| 485 | let relevant_libs: FxIndexSet<_> = relevant.filter_map(|lib| lib.filename).collect(); | ||
| 486 | |||
| 487 | let bundled_libs: FxIndexSet<_> = native_libs.filter_map(|lib| lib.filename).collect(); | ||
| 488 | ab.add_archive( | ||
| 489 | path, | ||
| 490 | Box::new(move |fname: &str| { | ||
| 491 | // Ignore metadata files, no matter the name. | ||
| 492 | if fname == METADATA_FILENAME { | ||
| 493 | return true; | ||
| 494 | } | ||
| 495 | 481 | ||
| 496 | // Don't include Rust objects if LTO is enabled | 482 | let native_libs = crate_info.native_libraries[&cnum].iter(); |
| 497 | if lto && looks_like_rust_object_file(fname) { | 483 | let relevant = native_libs.clone().filter(|lib| relevant_lib(sess, lib)); |
| 498 | return true; | 484 | let relevant_libs: FxIndexSet<_> = relevant.filter_map(|lib| lib.filename).collect(); |
| 499 | } | ||
| 500 | 485 | ||
| 501 | // Skip objects for bundled libs. | 486 | let bundled_libs: FxIndexSet<_> = native_libs.filter_map(|lib| lib.filename).collect(); |
| 502 | if bundled_libs.contains(&Symbol::intern(fname)) { | 487 | ab.add_archive( |
| 503 | return true; | 488 | path, |
| 504 | } | 489 | Box::new(move |fname: &str| { |
| 490 | // Ignore metadata files, no matter the name. | ||
| 491 | if fname == METADATA_FILENAME { | ||
| 492 | return true; | ||
| 493 | } | ||
| 505 | 494 | ||
| 506 | false | 495 | // Don't include Rust objects if LTO is enabled |
| 507 | }), | 496 | if lto && looks_like_rust_object_file(fname) { |
| 508 | ) | 497 | return true; |
| 509 | .unwrap(); | 498 | } |
| 510 | 499 | ||
| 511 | archive_builder_builder | 500 | // Skip objects for bundled libs. |
| 512 | .extract_bundled_libs(path, tempdir.as_ref(), &relevant_libs) | 501 | if bundled_libs.contains(&Symbol::intern(fname)) { |
| 513 | .unwrap_or_else(|e| sess.dcx().emit_fatal(e)); | 502 | return true; |
| 503 | } | ||
| 514 | 504 | ||
| 515 | for filename in relevant_libs.iter() { | 505 | false |
| 516 | let joined = tempdir.as_ref().join(filename.as_str()); | 506 | }), |
| 517 | let path = joined.as_path(); | 507 | ) |
| 518 | ab.add_archive(path, Box::new(|_| false)).unwrap(); | 508 | .unwrap(); |
| 519 | } | ||
| 520 | 509 | ||
| 521 | all_native_libs | 510 | archive_builder_builder |
| 522 | .extend(codegen_results.crate_info.native_libraries[&cnum].iter().cloned()); | 511 | .extract_bundled_libs(path, tempdir.as_ref(), &relevant_libs) |
| 523 | }, | 512 | .unwrap_or_else(|e| sess.dcx().emit_fatal(e)); |
| 524 | ); | 513 | |
| 514 | for filename in relevant_libs.iter() { | ||
| 515 | let joined = tempdir.as_ref().join(filename.as_str()); | ||
| 516 | let path = joined.as_path(); | ||
| 517 | ab.add_archive(path, Box::new(|_| false)).unwrap(); | ||
| 518 | } | ||
| 519 | |||
| 520 | all_native_libs.extend(crate_info.native_libraries[&cnum].iter().cloned()); | ||
| 521 | }); | ||
| 525 | if let Err(e) = res { | 522 | if let Err(e) = res { |
| 526 | sess.dcx().emit_fatal(e); | 523 | sess.dcx().emit_fatal(e); |
| 527 | } | 524 | } |
| 528 | 525 | ||
| 529 | ab.build(out_filename); | 526 | ab.build(out_filename); |
| 530 | 527 | ||
| 531 | let crates = codegen_results.crate_info.used_crates.iter(); | 528 | let crates = crate_info.used_crates.iter(); |
| 532 | 529 | ||
| 533 | let fmts = codegen_results | 530 | let fmts = crate_info |
| 534 | .crate_info | ||
| 535 | .dependency_formats | 531 | .dependency_formats |
| 536 | .get(&CrateType::StaticLib) | 532 | .get(&CrateType::StaticLib) |
| 537 | .expect("no dependency formats for staticlib"); | 533 | .expect("no dependency formats for staticlib"); |
| ... | @@ -541,8 +537,8 @@ fn link_staticlib( | ... | @@ -541,8 +537,8 @@ fn link_staticlib( |
| 541 | let Some(Linkage::Dynamic) = fmts.get(cnum) else { | 537 | let Some(Linkage::Dynamic) = fmts.get(cnum) else { |
| 542 | continue; | 538 | continue; |
| 543 | }; | 539 | }; |
| 544 | let crate_name = codegen_results.crate_info.crate_name[&cnum]; | 540 | let crate_name = crate_info.crate_name[&cnum]; |
| 545 | let used_crate_source = &codegen_results.crate_info.used_crate_source[&cnum]; | 541 | let used_crate_source = &crate_info.used_crate_source[&cnum]; |
| 546 | if let Some(path) = &used_crate_source.dylib { | 542 | if let Some(path) = &used_crate_source.dylib { |
| 547 | all_rust_dylibs.push(&**path); | 543 | all_rust_dylibs.push(&**path); |
| 548 | } else if used_crate_source.rmeta.is_some() { | 544 | } else if used_crate_source.rmeta.is_some() { |
| ... | @@ -552,7 +548,7 @@ fn link_staticlib( | ... | @@ -552,7 +548,7 @@ fn link_staticlib( |
| 552 | } | 548 | } |
| 553 | } | 549 | } |
| 554 | 550 | ||
| 555 | all_native_libs.extend_from_slice(&codegen_results.crate_info.used_libraries); | 551 | all_native_libs.extend_from_slice(&crate_info.used_libraries); |
| 556 | 552 | ||
| 557 | for print in &sess.opts.prints { | 553 | for print in &sess.opts.prints { |
| 558 | if print.kind == PrintKind::NativeStaticLibs { | 554 | if print.kind == PrintKind::NativeStaticLibs { |
| ... | @@ -563,7 +559,12 @@ fn link_staticlib( | ... | @@ -563,7 +559,12 @@ fn link_staticlib( |
| 563 | 559 | ||
| 564 | /// Use `thorin` (rust implementation of a dwarf packaging utility) to link DWARF objects into a | 560 | /// Use `thorin` (rust implementation of a dwarf packaging utility) to link DWARF objects into a |
| 565 | /// DWARF package. | 561 | /// DWARF package. |
| 566 | fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out_filename: &Path) { | 562 | fn link_dwarf_object( |
| 563 | sess: &Session, | ||
| 564 | compiled_modules: &CompiledModules, | ||
| 565 | crate_info: &CrateInfo, | ||
| 566 | executable_out_filename: &Path, | ||
| 567 | ) { | ||
| 567 | let mut dwp_out_filename = executable_out_filename.to_path_buf().into_os_string(); | 568 | let mut dwp_out_filename = executable_out_filename.to_path_buf().into_os_string(); |
| 568 | dwp_out_filename.push(".dwp"); | 569 | dwp_out_filename.push(".dwp"); |
| 569 | debug!(?dwp_out_filename, ?executable_out_filename); | 570 | debug!(?dwp_out_filename, ?executable_out_filename); |
| ... | @@ -604,20 +605,21 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out | ... | @@ -604,20 +605,21 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out |
| 604 | // Input objs contain .o/.dwo files from the current crate. | 605 | // Input objs contain .o/.dwo files from the current crate. |
| 605 | match sess.opts.unstable_opts.split_dwarf_kind { | 606 | match sess.opts.unstable_opts.split_dwarf_kind { |
| 606 | SplitDwarfKind::Single => { | 607 | SplitDwarfKind::Single => { |
| 607 | for input_obj in cg_results.modules.iter().filter_map(|m| m.object.as_ref()) { | 608 | for input_obj in compiled_modules.modules.iter().filter_map(|m| m.object.as_ref()) { |
| 608 | package.add_input_object(input_obj)?; | 609 | package.add_input_object(input_obj)?; |
| 609 | } | 610 | } |
| 610 | } | 611 | } |
| 611 | SplitDwarfKind::Split => { | 612 | SplitDwarfKind::Split => { |
| 612 | for input_obj in cg_results.modules.iter().filter_map(|m| m.dwarf_object.as_ref()) { | 613 | for input_obj in |
| 614 | compiled_modules.modules.iter().filter_map(|m| m.dwarf_object.as_ref()) | ||
| 615 | { | ||
| 613 | package.add_input_object(input_obj)?; | 616 | package.add_input_object(input_obj)?; |
| 614 | } | 617 | } |
| 615 | } | 618 | } |
| 616 | } | 619 | } |
| 617 | 620 | ||
| 618 | // Input rlibs contain .o/.dwo files from dependencies. | 621 | // Input rlibs contain .o/.dwo files from dependencies. |
| 619 | let input_rlibs = cg_results | 622 | let input_rlibs = crate_info |
| 620 | .crate_info | ||
| 621 | .used_crate_source | 623 | .used_crate_source |
| 622 | .items() | 624 | .items() |
| 623 | .filter_map(|(_, csource)| csource.rlib.as_ref()) | 625 | .filter_map(|(_, csource)| csource.rlib.as_ref()) |
| ... | @@ -679,7 +681,8 @@ fn link_natively( | ... | @@ -679,7 +681,8 @@ fn link_natively( |
| 679 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 681 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 680 | crate_type: CrateType, | 682 | crate_type: CrateType, |
| 681 | out_filename: &Path, | 683 | out_filename: &Path, |
| 682 | codegen_results: &CodegenResults, | 684 | compiled_modules: &CompiledModules, |
| 685 | crate_info: &CrateInfo, | ||
| 683 | metadata: &EncodedMetadata, | 686 | metadata: &EncodedMetadata, |
| 684 | tmpdir: &Path, | 687 | tmpdir: &Path, |
| 685 | codegen_backend: &'static str, | 688 | codegen_backend: &'static str, |
| ... | @@ -705,7 +708,8 @@ fn link_natively( | ... | @@ -705,7 +708,8 @@ fn link_natively( |
| 705 | crate_type, | 708 | crate_type, |
| 706 | tmpdir, | 709 | tmpdir, |
| 707 | temp_filename, | 710 | temp_filename, |
| 708 | codegen_results, | 711 | compiled_modules, |
| 712 | crate_info, | ||
| 709 | metadata, | 713 | metadata, |
| 710 | self_contained_components, | 714 | self_contained_components, |
| 711 | codegen_backend, | 715 | codegen_backend, |
| ... | @@ -936,7 +940,7 @@ fn link_natively( | ... | @@ -936,7 +940,7 @@ fn link_natively( |
| 936 | } | 940 | } |
| 937 | } | 941 | } |
| 938 | 942 | ||
| 939 | let level = codegen_results.crate_info.lint_levels.linker_messages; | 943 | let level = crate_info.lint_levels.linker_messages; |
| 940 | let lint = |msg| { | 944 | let lint = |msg| { |
| 941 | diag_lint_level(sess, LINKER_MESSAGES, level, None, LinkerOutput { inner: msg }); | 945 | diag_lint_level(sess, LINKER_MESSAGES, level, None, LinkerOutput { inner: msg }); |
| 942 | }; | 946 | }; |
| ... | @@ -1013,7 +1017,9 @@ fn link_natively( | ... | @@ -1013,7 +1017,9 @@ fn link_natively( |
| 1013 | // We cannot rely on the .o paths in the executable because they may have been | 1017 | // We cannot rely on the .o paths in the executable because they may have been |
| 1014 | // remapped by --remap-path-prefix and therefore invalid, so we need to provide | 1018 | // remapped by --remap-path-prefix and therefore invalid, so we need to provide |
| 1015 | // the .o/.dwo paths explicitly. | 1019 | // the .o/.dwo paths explicitly. |
| 1016 | SplitDebuginfo::Packed => link_dwarf_object(sess, codegen_results, out_filename), | 1020 | SplitDebuginfo::Packed => { |
| 1021 | link_dwarf_object(sess, compiled_modules, crate_info, out_filename) | ||
| 1022 | } | ||
| 1017 | } | 1023 | } |
| 1018 | 1024 | ||
| 1019 | let strip = sess.opts.cg.strip; | 1025 | let strip = sess.opts.cg.strip; |
| ... | @@ -1908,11 +1914,11 @@ fn add_late_link_args( | ... | @@ -1908,11 +1914,11 @@ fn add_late_link_args( |
| 1908 | sess: &Session, | 1914 | sess: &Session, |
| 1909 | flavor: LinkerFlavor, | 1915 | flavor: LinkerFlavor, |
| 1910 | crate_type: CrateType, | 1916 | crate_type: CrateType, |
| 1911 | codegen_results: &CodegenResults, | 1917 | crate_info: &CrateInfo, |
| 1912 | ) { | 1918 | ) { |
| 1913 | let any_dynamic_crate = crate_type == CrateType::Dylib | 1919 | let any_dynamic_crate = crate_type == CrateType::Dylib |
| 1914 | || crate_type == CrateType::Sdylib | 1920 | || crate_type == CrateType::Sdylib |
| 1915 | || codegen_results.crate_info.dependency_formats.iter().any(|(ty, list)| { | 1921 | || crate_info.dependency_formats.iter().any(|(ty, list)| { |
| 1916 | *ty == crate_type && list.iter().any(|&linkage| linkage == Linkage::Dynamic) | 1922 | *ty == crate_type && list.iter().any(|&linkage| linkage == Linkage::Dynamic) |
| 1917 | }); | 1923 | }); |
| 1918 | if any_dynamic_crate { | 1924 | if any_dynamic_crate { |
| ... | @@ -2074,8 +2080,8 @@ fn add_linked_symbol_object( | ... | @@ -2074,8 +2080,8 @@ fn add_linked_symbol_object( |
| 2074 | } | 2080 | } |
| 2075 | 2081 | ||
| 2076 | /// Add object files containing code from the current crate. | 2082 | /// Add object files containing code from the current crate. |
| 2077 | fn add_local_crate_regular_objects(cmd: &mut dyn Linker, codegen_results: &CodegenResults) { | 2083 | fn add_local_crate_regular_objects(cmd: &mut dyn Linker, compiled_modules: &CompiledModules) { |
| 2078 | for obj in codegen_results.modules.iter().filter_map(|m| m.object.as_ref()) { | 2084 | for obj in compiled_modules.modules.iter().filter_map(|m| m.object.as_ref()) { |
| 2079 | cmd.add_object(obj); | 2085 | cmd.add_object(obj); |
| 2080 | } | 2086 | } |
| 2081 | } | 2087 | } |
| ... | @@ -2083,12 +2089,13 @@ fn add_local_crate_regular_objects(cmd: &mut dyn Linker, codegen_results: &Codeg | ... | @@ -2083,12 +2089,13 @@ fn add_local_crate_regular_objects(cmd: &mut dyn Linker, codegen_results: &Codeg |
| 2083 | /// Add object files for allocator code linked once for the whole crate tree. | 2089 | /// Add object files for allocator code linked once for the whole crate tree. |
| 2084 | fn add_local_crate_allocator_objects( | 2090 | fn add_local_crate_allocator_objects( |
| 2085 | cmd: &mut dyn Linker, | 2091 | cmd: &mut dyn Linker, |
| 2086 | codegen_results: &CodegenResults, | 2092 | compiled_modules: &CompiledModules, |
| 2093 | crate_info: &CrateInfo, | ||
| 2087 | crate_type: CrateType, | 2094 | crate_type: CrateType, |
| 2088 | ) { | 2095 | ) { |
| 2089 | if needs_allocator_shim_for_linking(&codegen_results.crate_info.dependency_formats, crate_type) | 2096 | if needs_allocator_shim_for_linking(&crate_info.dependency_formats, crate_type) { |
| 2090 | { | 2097 | if let Some(obj) = |
| 2091 | if let Some(obj) = codegen_results.allocator_module.as_ref().and_then(|m| m.object.as_ref()) | 2098 | compiled_modules.allocator_module.as_ref().and_then(|m| m.object.as_ref()) |
| 2092 | { | 2099 | { |
| 2093 | cmd.add_object(obj); | 2100 | cmd.add_object(obj); |
| 2094 | } | 2101 | } |
| ... | @@ -2102,7 +2109,7 @@ fn add_local_crate_metadata_objects( | ... | @@ -2102,7 +2109,7 @@ fn add_local_crate_metadata_objects( |
| 2102 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 2109 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 2103 | crate_type: CrateType, | 2110 | crate_type: CrateType, |
| 2104 | tmpdir: &Path, | 2111 | tmpdir: &Path, |
| 2105 | codegen_results: &CodegenResults, | 2112 | crate_info: &CrateInfo, |
| 2106 | metadata: &EncodedMetadata, | 2113 | metadata: &EncodedMetadata, |
| 2107 | ) { | 2114 | ) { |
| 2108 | // When linking a dynamic library, we put the metadata into a section of the | 2115 | // When linking a dynamic library, we put the metadata into a section of the |
| ... | @@ -2112,7 +2119,7 @@ fn add_local_crate_metadata_objects( | ... | @@ -2112,7 +2119,7 @@ fn add_local_crate_metadata_objects( |
| 2112 | let data = archive_builder_builder.create_dylib_metadata_wrapper( | 2119 | let data = archive_builder_builder.create_dylib_metadata_wrapper( |
| 2113 | sess, | 2120 | sess, |
| 2114 | &metadata, | 2121 | &metadata, |
| 2115 | &codegen_results.crate_info.metadata_symbol, | 2122 | &crate_info.metadata_symbol, |
| 2116 | ); | 2123 | ); |
| 2117 | let obj = emit_wrapper_file(sess, &data, tmpdir, "rmeta.o"); | 2124 | let obj = emit_wrapper_file(sess, &data, tmpdir, "rmeta.o"); |
| 2118 | 2125 | ||
| ... | @@ -2157,7 +2164,7 @@ fn add_relro_args(cmd: &mut dyn Linker, sess: &Session) { | ... | @@ -2157,7 +2164,7 @@ fn add_relro_args(cmd: &mut dyn Linker, sess: &Session) { |
| 2157 | fn add_rpath_args( | 2164 | fn add_rpath_args( |
| 2158 | cmd: &mut dyn Linker, | 2165 | cmd: &mut dyn Linker, |
| 2159 | sess: &Session, | 2166 | sess: &Session, |
| 2160 | codegen_results: &CodegenResults, | 2167 | crate_info: &CrateInfo, |
| 2161 | out_filename: &Path, | 2168 | out_filename: &Path, |
| 2162 | ) { | 2169 | ) { |
| 2163 | if !sess.target.has_rpath { | 2170 | if !sess.target.has_rpath { |
| ... | @@ -2168,11 +2175,10 @@ fn add_rpath_args( | ... | @@ -2168,11 +2175,10 @@ fn add_rpath_args( |
| 2168 | // where extern libraries might live, based on the | 2175 | // where extern libraries might live, based on the |
| 2169 | // add_lib_search_paths | 2176 | // add_lib_search_paths |
| 2170 | if sess.opts.cg.rpath { | 2177 | if sess.opts.cg.rpath { |
| 2171 | let libs = codegen_results | 2178 | let libs = crate_info |
| 2172 | .crate_info | ||
| 2173 | .used_crates | 2179 | .used_crates |
| 2174 | .iter() | 2180 | .iter() |
| 2175 | .filter_map(|cnum| codegen_results.crate_info.used_crate_source[cnum].dylib.as_deref()) | 2181 | .filter_map(|cnum| crate_info.used_crate_source[cnum].dylib.as_deref()) |
| 2176 | .collect::<Vec<_>>(); | 2182 | .collect::<Vec<_>>(); |
| 2177 | let rpath_config = RPathConfig { | 2183 | let rpath_config = RPathConfig { |
| 2178 | libs: &*libs, | 2184 | libs: &*libs, |
| ... | @@ -2265,7 +2271,8 @@ fn linker_with_args( | ... | @@ -2265,7 +2271,8 @@ fn linker_with_args( |
| 2265 | crate_type: CrateType, | 2271 | crate_type: CrateType, |
| 2266 | tmpdir: &Path, | 2272 | tmpdir: &Path, |
| 2267 | out_filename: &Path, | 2273 | out_filename: &Path, |
| 2268 | codegen_results: &CodegenResults, | 2274 | compiled_modules: &CompiledModules, |
| 2275 | crate_info: &CrateInfo, | ||
| 2269 | metadata: &EncodedMetadata, | 2276 | metadata: &EncodedMetadata, |
| 2270 | self_contained_components: LinkSelfContainedComponents, | 2277 | self_contained_components: LinkSelfContainedComponents, |
| 2271 | codegen_backend: &'static str, | 2278 | codegen_backend: &'static str, |
| ... | @@ -2276,17 +2283,17 @@ fn linker_with_args( | ... | @@ -2276,17 +2283,17 @@ fn linker_with_args( |
| 2276 | path, | 2283 | path, |
| 2277 | flavor, | 2284 | flavor, |
| 2278 | self_contained_components.are_any_components_enabled(), | 2285 | self_contained_components.are_any_components_enabled(), |
| 2279 | &codegen_results.crate_info.target_cpu, | 2286 | &crate_info.target_cpu, |
| 2280 | codegen_backend, | 2287 | codegen_backend, |
| 2281 | ); | 2288 | ); |
| 2282 | let link_output_kind = link_output_kind(sess, crate_type); | 2289 | let link_output_kind = link_output_kind(sess, crate_type); |
| 2283 | 2290 | ||
| 2284 | let mut export_symbols = codegen_results.crate_info.exported_symbols[&crate_type].clone(); | 2291 | let mut export_symbols = crate_info.exported_symbols[&crate_type].clone(); |
| 2285 | 2292 | ||
| 2286 | if crate_type == CrateType::Cdylib { | 2293 | if crate_type == CrateType::Cdylib { |
| 2287 | let mut seen = FxHashSet::default(); | 2294 | let mut seen = FxHashSet::default(); |
| 2288 | 2295 | ||
| 2289 | for lib in &codegen_results.crate_info.used_libraries { | 2296 | for lib in &crate_info.used_libraries { |
| 2290 | if let NativeLibKind::Static { export_symbols: Some(true), .. } = lib.kind | 2297 | if let NativeLibKind::Static { export_symbols: Some(true), .. } = lib.kind |
| 2291 | && seen.insert((lib.name, lib.verbatim)) | 2298 | && seen.insert((lib.name, lib.verbatim)) |
| 2292 | { | 2299 | { |
| ... | @@ -2320,12 +2327,7 @@ fn linker_with_args( | ... | @@ -2320,12 +2327,7 @@ fn linker_with_args( |
| 2320 | // Pre-link CRT objects. | 2327 | // Pre-link CRT objects. |
| 2321 | add_pre_link_objects(cmd, sess, flavor, link_output_kind, self_contained_crt_objects); | 2328 | add_pre_link_objects(cmd, sess, flavor, link_output_kind, self_contained_crt_objects); |
| 2322 | 2329 | ||
| 2323 | add_linked_symbol_object( | 2330 | add_linked_symbol_object(cmd, sess, tmpdir, &crate_info.linked_symbols[&crate_type]); |
| 2324 | cmd, | ||
| 2325 | sess, | ||
| 2326 | tmpdir, | ||
| 2327 | &codegen_results.crate_info.linked_symbols[&crate_type], | ||
| 2328 | ); | ||
| 2329 | 2331 | ||
| 2330 | // Sanitizer libraries. | 2332 | // Sanitizer libraries. |
| 2331 | add_sanitizer_libraries(sess, flavor, crate_type, cmd); | 2333 | add_sanitizer_libraries(sess, flavor, crate_type, cmd); |
| ... | @@ -2357,17 +2359,17 @@ fn linker_with_args( | ... | @@ -2357,17 +2359,17 @@ fn linker_with_args( |
| 2357 | // link line. And finally upstream native libraries can't depend on anything | 2359 | // link line. And finally upstream native libraries can't depend on anything |
| 2358 | // in this DAG so far because they can only depend on other native libraries | 2360 | // in this DAG so far because they can only depend on other native libraries |
| 2359 | // and such dependencies are also required to be specified. | 2361 | // and such dependencies are also required to be specified. |
| 2360 | add_local_crate_regular_objects(cmd, codegen_results); | 2362 | add_local_crate_regular_objects(cmd, compiled_modules); |
| 2361 | add_local_crate_metadata_objects( | 2363 | add_local_crate_metadata_objects( |
| 2362 | cmd, | 2364 | cmd, |
| 2363 | sess, | 2365 | sess, |
| 2364 | archive_builder_builder, | 2366 | archive_builder_builder, |
| 2365 | crate_type, | 2367 | crate_type, |
| 2366 | tmpdir, | 2368 | tmpdir, |
| 2367 | codegen_results, | 2369 | crate_info, |
| 2368 | metadata, | 2370 | metadata, |
| 2369 | ); | 2371 | ); |
| 2370 | add_local_crate_allocator_objects(cmd, codegen_results, crate_type); | 2372 | add_local_crate_allocator_objects(cmd, compiled_modules, crate_info, crate_type); |
| 2371 | 2373 | ||
| 2372 | // Avoid linking to dynamic libraries unless they satisfy some undefined symbols | 2374 | // Avoid linking to dynamic libraries unless they satisfy some undefined symbols |
| 2373 | // at the point at which they are specified on the command line. | 2375 | // at the point at which they are specified on the command line. |
| ... | @@ -2384,7 +2386,7 @@ fn linker_with_args( | ... | @@ -2384,7 +2386,7 @@ fn linker_with_args( |
| 2384 | cmd, | 2386 | cmd, |
| 2385 | sess, | 2387 | sess, |
| 2386 | archive_builder_builder, | 2388 | archive_builder_builder, |
| 2387 | codegen_results, | 2389 | crate_info, |
| 2388 | tmpdir, | 2390 | tmpdir, |
| 2389 | link_output_kind, | 2391 | link_output_kind, |
| 2390 | ); | 2392 | ); |
| ... | @@ -2394,7 +2396,7 @@ fn linker_with_args( | ... | @@ -2394,7 +2396,7 @@ fn linker_with_args( |
| 2394 | cmd, | 2396 | cmd, |
| 2395 | sess, | 2397 | sess, |
| 2396 | archive_builder_builder, | 2398 | archive_builder_builder, |
| 2397 | codegen_results, | 2399 | crate_info, |
| 2398 | crate_type, | 2400 | crate_type, |
| 2399 | tmpdir, | 2401 | tmpdir, |
| 2400 | link_output_kind, | 2402 | link_output_kind, |
| ... | @@ -2405,7 +2407,7 @@ fn linker_with_args( | ... | @@ -2405,7 +2407,7 @@ fn linker_with_args( |
| 2405 | cmd, | 2407 | cmd, |
| 2406 | sess, | 2408 | sess, |
| 2407 | archive_builder_builder, | 2409 | archive_builder_builder, |
| 2408 | codegen_results, | 2410 | crate_info, |
| 2409 | tmpdir, | 2411 | tmpdir, |
| 2410 | link_output_kind, | 2412 | link_output_kind, |
| 2411 | ); | 2413 | ); |
| ... | @@ -2428,7 +2430,7 @@ fn linker_with_args( | ... | @@ -2428,7 +2430,7 @@ fn linker_with_args( |
| 2428 | for output_path in raw_dylib::create_raw_dylib_dll_import_libs( | 2430 | for output_path in raw_dylib::create_raw_dylib_dll_import_libs( |
| 2429 | sess, | 2431 | sess, |
| 2430 | archive_builder_builder, | 2432 | archive_builder_builder, |
| 2431 | codegen_results.crate_info.used_libraries.iter(), | 2433 | crate_info.used_libraries.iter(), |
| 2432 | tmpdir, | 2434 | tmpdir, |
| 2433 | true, | 2435 | true, |
| 2434 | ) { | 2436 | ) { |
| ... | @@ -2437,7 +2439,7 @@ fn linker_with_args( | ... | @@ -2437,7 +2439,7 @@ fn linker_with_args( |
| 2437 | } else { | 2439 | } else { |
| 2438 | for (link_path, as_needed) in raw_dylib::create_raw_dylib_elf_stub_shared_objects( | 2440 | for (link_path, as_needed) in raw_dylib::create_raw_dylib_elf_stub_shared_objects( |
| 2439 | sess, | 2441 | sess, |
| 2440 | codegen_results.crate_info.used_libraries.iter(), | 2442 | crate_info.used_libraries.iter(), |
| 2441 | &raw_dylib_dir, | 2443 | &raw_dylib_dir, |
| 2442 | ) { | 2444 | ) { |
| 2443 | // Always use verbatim linkage, see comments in create_raw_dylib_elf_stub_shared_objects. | 2445 | // Always use verbatim linkage, see comments in create_raw_dylib_elf_stub_shared_objects. |
| ... | @@ -2448,16 +2450,14 @@ fn linker_with_args( | ... | @@ -2448,16 +2450,14 @@ fn linker_with_args( |
| 2448 | // they are used within inlined functions or instantiated generic functions. We do this *after* | 2450 | // they are used within inlined functions or instantiated generic functions. We do this *after* |
| 2449 | // handling the raw-dylib symbols in the current crate to make sure that those are chosen first | 2451 | // handling the raw-dylib symbols in the current crate to make sure that those are chosen first |
| 2450 | // by the linker. | 2452 | // by the linker. |
| 2451 | let dependency_linkage = codegen_results | 2453 | let dependency_linkage = crate_info |
| 2452 | .crate_info | ||
| 2453 | .dependency_formats | 2454 | .dependency_formats |
| 2454 | .get(&crate_type) | 2455 | .get(&crate_type) |
| 2455 | .expect("failed to find crate type in dependency format list"); | 2456 | .expect("failed to find crate type in dependency format list"); |
| 2456 | 2457 | ||
| 2457 | // We sort the libraries below | 2458 | // We sort the libraries below |
| 2458 | #[allow(rustc::potential_query_instability)] | 2459 | #[allow(rustc::potential_query_instability)] |
| 2459 | let mut native_libraries_from_nonstatics = codegen_results | 2460 | let mut native_libraries_from_nonstatics = crate_info |
| 2460 | .crate_info | ||
| 2461 | .native_libraries | 2461 | .native_libraries |
| 2462 | .iter() | 2462 | .iter() |
| 2463 | .filter_map(|(&cnum, libraries)| { | 2463 | .filter_map(|(&cnum, libraries)| { |
| ... | @@ -2499,7 +2499,7 @@ fn linker_with_args( | ... | @@ -2499,7 +2499,7 @@ fn linker_with_args( |
| 2499 | // FIXME: Built-in target specs occasionally use this for linking system libraries, | 2499 | // FIXME: Built-in target specs occasionally use this for linking system libraries, |
| 2500 | // eliminate all such uses by migrating them to `#[link]` attributes in `lib(std,c,unwind)` | 2500 | // eliminate all such uses by migrating them to `#[link]` attributes in `lib(std,c,unwind)` |
| 2501 | // and remove the option. | 2501 | // and remove the option. |
| 2502 | add_late_link_args(cmd, sess, flavor, crate_type, codegen_results); | 2502 | add_late_link_args(cmd, sess, flavor, crate_type, crate_info); |
| 2503 | 2503 | ||
| 2504 | // ------------ Arbitrary order-independent options ------------ | 2504 | // ------------ Arbitrary order-independent options ------------ |
| 2505 | 2505 | ||
| ... | @@ -2512,7 +2512,7 @@ fn linker_with_args( | ... | @@ -2512,7 +2512,7 @@ fn linker_with_args( |
| 2512 | self_contained_components, | 2512 | self_contained_components, |
| 2513 | flavor, | 2513 | flavor, |
| 2514 | crate_type, | 2514 | crate_type, |
| 2515 | codegen_results, | 2515 | crate_info, |
| 2516 | out_filename, | 2516 | out_filename, |
| 2517 | tmpdir, | 2517 | tmpdir, |
| 2518 | ); | 2518 | ); |
| ... | @@ -2552,7 +2552,7 @@ fn add_order_independent_options( | ... | @@ -2552,7 +2552,7 @@ fn add_order_independent_options( |
| 2552 | self_contained_components: LinkSelfContainedComponents, | 2552 | self_contained_components: LinkSelfContainedComponents, |
| 2553 | flavor: LinkerFlavor, | 2553 | flavor: LinkerFlavor, |
| 2554 | crate_type: CrateType, | 2554 | crate_type: CrateType, |
| 2555 | codegen_results: &CodegenResults, | 2555 | crate_info: &CrateInfo, |
| 2556 | out_filename: &Path, | 2556 | out_filename: &Path, |
| 2557 | tmpdir: &Path, | 2557 | tmpdir: &Path, |
| 2558 | ) { | 2558 | ) { |
| ... | @@ -2597,18 +2597,15 @@ fn add_order_independent_options( | ... | @@ -2597,18 +2597,15 @@ fn add_order_independent_options( |
| 2597 | "--target", | 2597 | "--target", |
| 2598 | &versioned_llvm_target(sess), | 2598 | &versioned_llvm_target(sess), |
| 2599 | "--target-cpu", | 2599 | "--target-cpu", |
| 2600 | &codegen_results.crate_info.target_cpu, | 2600 | &crate_info.target_cpu, |
| 2601 | ]); | 2601 | ]); |
| 2602 | if codegen_results.crate_info.target_features.len() > 0 { | 2602 | if crate_info.target_features.len() > 0 { |
| 2603 | cmd.link_arg(&format!( | 2603 | cmd.link_arg(&format!("--target-feature={}", &crate_info.target_features.join(","))); |
| 2604 | "--target-feature={}", | ||
| 2605 | &codegen_results.crate_info.target_features.join(",") | ||
| 2606 | )); | ||
| 2607 | } | 2604 | } |
| 2608 | } else if flavor == LinkerFlavor::Ptx { | 2605 | } else if flavor == LinkerFlavor::Ptx { |
| 2609 | cmd.link_args(&["--fallback-arch", &codegen_results.crate_info.target_cpu]); | 2606 | cmd.link_args(&["--fallback-arch", &crate_info.target_cpu]); |
| 2610 | } else if flavor == LinkerFlavor::Bpf { | 2607 | } else if flavor == LinkerFlavor::Bpf { |
| 2611 | cmd.link_args(&["--cpu", &codegen_results.crate_info.target_cpu]); | 2608 | cmd.link_args(&["--cpu", &crate_info.target_cpu]); |
| 2612 | if let Some(feat) = [sess.opts.cg.target_feature.as_str(), &sess.target.options.features] | 2609 | if let Some(feat) = [sess.opts.cg.target_feature.as_str(), &sess.target.options.features] |
| 2613 | .into_iter() | 2610 | .into_iter() |
| 2614 | .find(|feat| !feat.is_empty()) | 2611 | .find(|feat| !feat.is_empty()) |
| ... | @@ -2625,7 +2622,7 @@ fn add_order_independent_options( | ... | @@ -2625,7 +2622,7 @@ fn add_order_independent_options( |
| 2625 | 2622 | ||
| 2626 | if crate_type == CrateType::Executable | 2623 | if crate_type == CrateType::Executable |
| 2627 | && sess.target.is_like_windows | 2624 | && sess.target.is_like_windows |
| 2628 | && let Some(s) = &codegen_results.crate_info.windows_subsystem | 2625 | && let Some(s) = &crate_info.windows_subsystem |
| 2629 | { | 2626 | { |
| 2630 | cmd.windows_subsystem(*s); | 2627 | cmd.windows_subsystem(*s); |
| 2631 | } | 2628 | } |
| ... | @@ -2653,8 +2650,8 @@ fn add_order_independent_options( | ... | @@ -2653,8 +2650,8 @@ fn add_order_independent_options( |
| 2653 | let natvis_visualizers = collect_natvis_visualizers( | 2650 | let natvis_visualizers = collect_natvis_visualizers( |
| 2654 | tmpdir, | 2651 | tmpdir, |
| 2655 | sess, | 2652 | sess, |
| 2656 | &codegen_results.crate_info.local_crate_name, | 2653 | &crate_info.local_crate_name, |
| 2657 | &codegen_results.crate_info.natvis_debugger_visualizers, | 2654 | &crate_info.natvis_debugger_visualizers, |
| 2658 | ); | 2655 | ); |
| 2659 | 2656 | ||
| 2660 | // Pass debuginfo, NatVis debugger visualizers and strip flags down to the linker. | 2657 | // Pass debuginfo, NatVis debugger visualizers and strip flags down to the linker. |
| ... | @@ -2679,7 +2676,7 @@ fn add_order_independent_options( | ... | @@ -2679,7 +2676,7 @@ fn add_order_independent_options( |
| 2679 | cmd.ehcont_guard(); | 2676 | cmd.ehcont_guard(); |
| 2680 | } | 2677 | } |
| 2681 | 2678 | ||
| 2682 | add_rpath_args(cmd, sess, codegen_results, out_filename); | 2679 | add_rpath_args(cmd, sess, crate_info, out_filename); |
| 2683 | } | 2680 | } |
| 2684 | 2681 | ||
| 2685 | // Write the NatVis debugger visualizer files for each crate to the temp directory and gather the file paths. | 2682 | // Write the NatVis debugger visualizer files for each crate to the temp directory and gather the file paths. |
| ... | @@ -2713,7 +2710,7 @@ fn add_native_libs_from_crate( | ... | @@ -2713,7 +2710,7 @@ fn add_native_libs_from_crate( |
| 2713 | cmd: &mut dyn Linker, | 2710 | cmd: &mut dyn Linker, |
| 2714 | sess: &Session, | 2711 | sess: &Session, |
| 2715 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 2712 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 2716 | codegen_results: &CodegenResults, | 2713 | crate_info: &CrateInfo, |
| 2717 | tmpdir: &Path, | 2714 | tmpdir: &Path, |
| 2718 | bundled_libs: &FxIndexSet<Symbol>, | 2715 | bundled_libs: &FxIndexSet<Symbol>, |
| 2719 | cnum: CrateNum, | 2716 | cnum: CrateNum, |
| ... | @@ -2730,15 +2727,15 @@ fn add_native_libs_from_crate( | ... | @@ -2730,15 +2727,15 @@ fn add_native_libs_from_crate( |
| 2730 | 2727 | ||
| 2731 | if link_static && cnum != LOCAL_CRATE && !bundled_libs.is_empty() { | 2728 | if link_static && cnum != LOCAL_CRATE && !bundled_libs.is_empty() { |
| 2732 | // If rlib contains native libs as archives, unpack them to tmpdir. | 2729 | // If rlib contains native libs as archives, unpack them to tmpdir. |
| 2733 | let rlib = codegen_results.crate_info.used_crate_source[&cnum].rlib.as_ref().unwrap(); | 2730 | let rlib = crate_info.used_crate_source[&cnum].rlib.as_ref().unwrap(); |
| 2734 | archive_builder_builder | 2731 | archive_builder_builder |
| 2735 | .extract_bundled_libs(rlib, tmpdir, bundled_libs) | 2732 | .extract_bundled_libs(rlib, tmpdir, bundled_libs) |
| 2736 | .unwrap_or_else(|e| sess.dcx().emit_fatal(e)); | 2733 | .unwrap_or_else(|e| sess.dcx().emit_fatal(e)); |
| 2737 | } | 2734 | } |
| 2738 | 2735 | ||
| 2739 | let native_libs = match cnum { | 2736 | let native_libs = match cnum { |
| 2740 | LOCAL_CRATE => &codegen_results.crate_info.used_libraries, | 2737 | LOCAL_CRATE => &crate_info.used_libraries, |
| 2741 | _ => &codegen_results.crate_info.native_libraries[&cnum], | 2738 | _ => &crate_info.native_libraries[&cnum], |
| 2742 | }; | 2739 | }; |
| 2743 | 2740 | ||
| 2744 | let mut last = (None, NativeLibKind::Unspecified, false); | 2741 | let mut last = (None, NativeLibKind::Unspecified, false); |
| ... | @@ -2814,7 +2811,7 @@ fn add_local_native_libraries( | ... | @@ -2814,7 +2811,7 @@ fn add_local_native_libraries( |
| 2814 | cmd: &mut dyn Linker, | 2811 | cmd: &mut dyn Linker, |
| 2815 | sess: &Session, | 2812 | sess: &Session, |
| 2816 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 2813 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 2817 | codegen_results: &CodegenResults, | 2814 | crate_info: &CrateInfo, |
| 2818 | tmpdir: &Path, | 2815 | tmpdir: &Path, |
| 2819 | link_output_kind: LinkOutputKind, | 2816 | link_output_kind: LinkOutputKind, |
| 2820 | ) { | 2817 | ) { |
| ... | @@ -2825,7 +2822,7 @@ fn add_local_native_libraries( | ... | @@ -2825,7 +2822,7 @@ fn add_local_native_libraries( |
| 2825 | cmd, | 2822 | cmd, |
| 2826 | sess, | 2823 | sess, |
| 2827 | archive_builder_builder, | 2824 | archive_builder_builder, |
| 2828 | codegen_results, | 2825 | crate_info, |
| 2829 | tmpdir, | 2826 | tmpdir, |
| 2830 | &Default::default(), | 2827 | &Default::default(), |
| 2831 | LOCAL_CRATE, | 2828 | LOCAL_CRATE, |
| ... | @@ -2839,7 +2836,7 @@ fn add_upstream_rust_crates( | ... | @@ -2839,7 +2836,7 @@ fn add_upstream_rust_crates( |
| 2839 | cmd: &mut dyn Linker, | 2836 | cmd: &mut dyn Linker, |
| 2840 | sess: &Session, | 2837 | sess: &Session, |
| 2841 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 2838 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 2842 | codegen_results: &CodegenResults, | 2839 | crate_info: &CrateInfo, |
| 2843 | crate_type: CrateType, | 2840 | crate_type: CrateType, |
| 2844 | tmpdir: &Path, | 2841 | tmpdir: &Path, |
| 2845 | link_output_kind: LinkOutputKind, | 2842 | link_output_kind: LinkOutputKind, |
| ... | @@ -2851,8 +2848,7 @@ fn add_upstream_rust_crates( | ... | @@ -2851,8 +2848,7 @@ fn add_upstream_rust_crates( |
| 2851 | // Linking to a rlib involves just passing it to the linker (the linker | 2848 | // Linking to a rlib involves just passing it to the linker (the linker |
| 2852 | // will slurp up the object files inside), and linking to a dynamic library | 2849 | // will slurp up the object files inside), and linking to a dynamic library |
| 2853 | // involves just passing the right -l flag. | 2850 | // involves just passing the right -l flag. |
| 2854 | let data = codegen_results | 2851 | let data = crate_info |
| 2855 | .crate_info | ||
| 2856 | .dependency_formats | 2852 | .dependency_formats |
| 2857 | .get(&crate_type) | 2853 | .get(&crate_type) |
| 2858 | .expect("failed to find crate type in dependency format list"); | 2854 | .expect("failed to find crate type in dependency format list"); |
| ... | @@ -2866,7 +2862,7 @@ fn add_upstream_rust_crates( | ... | @@ -2866,7 +2862,7 @@ fn add_upstream_rust_crates( |
| 2866 | cmd.link_or_cc_arg("-bnoipath"); | 2862 | cmd.link_or_cc_arg("-bnoipath"); |
| 2867 | } | 2863 | } |
| 2868 | 2864 | ||
| 2869 | for &cnum in &codegen_results.crate_info.used_crates { | 2865 | for &cnum in &crate_info.used_crates { |
| 2870 | // We may not pass all crates through to the linker. Some crates may appear statically in | 2866 | // We may not pass all crates through to the linker. Some crates may appear statically in |
| 2871 | // an existing dylib, meaning we'll pick up all the symbols from the dylib. | 2867 | // an existing dylib, meaning we'll pick up all the symbols from the dylib. |
| 2872 | // We must always link crates `compiler_builtins` and `profiler_builtins` statically. | 2868 | // We must always link crates `compiler_builtins` and `profiler_builtins` statically. |
| ... | @@ -2875,14 +2871,14 @@ fn add_upstream_rust_crates( | ... | @@ -2875,14 +2871,14 @@ fn add_upstream_rust_crates( |
| 2875 | let linkage = data[cnum]; | 2871 | let linkage = data[cnum]; |
| 2876 | let link_static_crate = linkage == Linkage::Static | 2872 | let link_static_crate = linkage == Linkage::Static |
| 2877 | || linkage == Linkage::IncludedFromDylib | 2873 | || linkage == Linkage::IncludedFromDylib |
| 2878 | && (codegen_results.crate_info.compiler_builtins == Some(cnum) | 2874 | && (crate_info.compiler_builtins == Some(cnum) |
| 2879 | || codegen_results.crate_info.profiler_runtime == Some(cnum)); | 2875 | || crate_info.profiler_runtime == Some(cnum)); |
| 2880 | 2876 | ||
| 2881 | let mut bundled_libs = Default::default(); | 2877 | let mut bundled_libs = Default::default(); |
| 2882 | match linkage { | 2878 | match linkage { |
| 2883 | Linkage::Static | Linkage::IncludedFromDylib | Linkage::NotLinked => { | 2879 | Linkage::Static | Linkage::IncludedFromDylib | Linkage::NotLinked => { |
| 2884 | if link_static_crate { | 2880 | if link_static_crate { |
| 2885 | bundled_libs = codegen_results.crate_info.native_libraries[&cnum] | 2881 | bundled_libs = crate_info.native_libraries[&cnum] |
| 2886 | .iter() | 2882 | .iter() |
| 2887 | .filter_map(|lib| lib.filename) | 2883 | .filter_map(|lib| lib.filename) |
| 2888 | .collect(); | 2884 | .collect(); |
| ... | @@ -2890,7 +2886,7 @@ fn add_upstream_rust_crates( | ... | @@ -2890,7 +2886,7 @@ fn add_upstream_rust_crates( |
| 2890 | cmd, | 2886 | cmd, |
| 2891 | sess, | 2887 | sess, |
| 2892 | archive_builder_builder, | 2888 | archive_builder_builder, |
| 2893 | codegen_results, | 2889 | crate_info, |
| 2894 | tmpdir, | 2890 | tmpdir, |
| 2895 | cnum, | 2891 | cnum, |
| 2896 | &bundled_libs, | 2892 | &bundled_libs, |
| ... | @@ -2898,7 +2894,7 @@ fn add_upstream_rust_crates( | ... | @@ -2898,7 +2894,7 @@ fn add_upstream_rust_crates( |
| 2898 | } | 2894 | } |
| 2899 | } | 2895 | } |
| 2900 | Linkage::Dynamic => { | 2896 | Linkage::Dynamic => { |
| 2901 | let src = &codegen_results.crate_info.used_crate_source[&cnum]; | 2897 | let src = &crate_info.used_crate_source[&cnum]; |
| 2902 | add_dynamic_crate(cmd, sess, src.dylib.as_ref().unwrap()); | 2898 | add_dynamic_crate(cmd, sess, src.dylib.as_ref().unwrap()); |
| 2903 | } | 2899 | } |
| 2904 | } | 2900 | } |
| ... | @@ -2918,7 +2914,7 @@ fn add_upstream_rust_crates( | ... | @@ -2918,7 +2914,7 @@ fn add_upstream_rust_crates( |
| 2918 | cmd, | 2914 | cmd, |
| 2919 | sess, | 2915 | sess, |
| 2920 | archive_builder_builder, | 2916 | archive_builder_builder, |
| 2921 | codegen_results, | 2917 | crate_info, |
| 2922 | tmpdir, | 2918 | tmpdir, |
| 2923 | &bundled_libs, | 2919 | &bundled_libs, |
| 2924 | cnum, | 2920 | cnum, |
| ... | @@ -2933,11 +2929,11 @@ fn add_upstream_native_libraries( | ... | @@ -2933,11 +2929,11 @@ fn add_upstream_native_libraries( |
| 2933 | cmd: &mut dyn Linker, | 2929 | cmd: &mut dyn Linker, |
| 2934 | sess: &Session, | 2930 | sess: &Session, |
| 2935 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 2931 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 2936 | codegen_results: &CodegenResults, | 2932 | crate_info: &CrateInfo, |
| 2937 | tmpdir: &Path, | 2933 | tmpdir: &Path, |
| 2938 | link_output_kind: LinkOutputKind, | 2934 | link_output_kind: LinkOutputKind, |
| 2939 | ) { | 2935 | ) { |
| 2940 | for &cnum in &codegen_results.crate_info.used_crates { | 2936 | for &cnum in &crate_info.used_crates { |
| 2941 | // Static libraries are not linked here, they are linked in `add_upstream_rust_crates`. | 2937 | // Static libraries are not linked here, they are linked in `add_upstream_rust_crates`. |
| 2942 | // FIXME: Merge this function to `add_upstream_rust_crates` so that all native libraries | 2938 | // FIXME: Merge this function to `add_upstream_rust_crates` so that all native libraries |
| 2943 | // are linked together with their respective upstream crates, and in their originally | 2939 | // are linked together with their respective upstream crates, and in their originally |
| ... | @@ -2956,7 +2952,7 @@ fn add_upstream_native_libraries( | ... | @@ -2956,7 +2952,7 @@ fn add_upstream_native_libraries( |
| 2956 | cmd, | 2952 | cmd, |
| 2957 | sess, | 2953 | sess, |
| 2958 | archive_builder_builder, | 2954 | archive_builder_builder, |
| 2959 | codegen_results, | 2955 | crate_info, |
| 2960 | tmpdir, | 2956 | tmpdir, |
| 2961 | &Default::default(), | 2957 | &Default::default(), |
| 2962 | cnum, | 2958 | cnum, |
| ... | @@ -3021,19 +3017,18 @@ fn add_static_crate( | ... | @@ -3021,19 +3017,18 @@ fn add_static_crate( |
| 3021 | cmd: &mut dyn Linker, | 3017 | cmd: &mut dyn Linker, |
| 3022 | sess: &Session, | 3018 | sess: &Session, |
| 3023 | archive_builder_builder: &dyn ArchiveBuilderBuilder, | 3019 | archive_builder_builder: &dyn ArchiveBuilderBuilder, |
| 3024 | codegen_results: &CodegenResults, | 3020 | crate_info: &CrateInfo, |
| 3025 | tmpdir: &Path, | 3021 | tmpdir: &Path, |
| 3026 | cnum: CrateNum, | 3022 | cnum: CrateNum, |
| 3027 | bundled_lib_file_names: &FxIndexSet<Symbol>, | 3023 | bundled_lib_file_names: &FxIndexSet<Symbol>, |
| 3028 | ) { | 3024 | ) { |
| 3029 | let src = &codegen_results.crate_info.used_crate_source[&cnum]; | 3025 | let src = &crate_info.used_crate_source[&cnum]; |
| 3030 | let cratepath = src.rlib.as_ref().unwrap(); | 3026 | let cratepath = src.rlib.as_ref().unwrap(); |
| 3031 | 3027 | ||
| 3032 | let mut link_upstream = | 3028 | let mut link_upstream = |
| 3033 | |path: &Path| cmd.link_staticlib_by_path(&rehome_lib_path(sess, path), false); | 3029 | |path: &Path| cmd.link_staticlib_by_path(&rehome_lib_path(sess, path), false); |
| 3034 | 3030 | ||
| 3035 | if !are_upstream_rust_objects_already_included(sess) | 3031 | if !are_upstream_rust_objects_already_included(sess) || ignored_for_lto(sess, crate_info, cnum) |
| 3036 | || ignored_for_lto(sess, &codegen_results.crate_info, cnum) | ||
| 3037 | { | 3032 | { |
| 3038 | link_upstream(cratepath); | 3033 | link_upstream(cratepath); |
| 3039 | return; | 3034 | return; |
| ... | @@ -3048,8 +3043,7 @@ fn add_static_crate( | ... | @@ -3048,8 +3043,7 @@ fn add_static_crate( |
| 3048 | let canonical_name = name.replace('-', "_"); | 3043 | let canonical_name = name.replace('-', "_"); |
| 3049 | let upstream_rust_objects_already_included = | 3044 | let upstream_rust_objects_already_included = |
| 3050 | are_upstream_rust_objects_already_included(sess); | 3045 | are_upstream_rust_objects_already_included(sess); |
| 3051 | let is_builtins = | 3046 | let is_builtins = sess.target.no_builtins || !crate_info.is_no_builtins.contains(&cnum); |
| 3052 | sess.target.no_builtins || !codegen_results.crate_info.is_no_builtins.contains(&cnum); | ||
| 3053 | 3047 | ||
| 3054 | let mut archive = archive_builder_builder.new_archive_builder(sess); | 3048 | let mut archive = archive_builder_builder.new_archive_builder(sess); |
| 3055 | if let Err(error) = archive.add_archive( | 3049 | if let Err(error) = archive.add_archive( |
compiler/rustc_codegen_ssa/src/back/write.rs+10-30| ... | @@ -42,7 +42,7 @@ use crate::back::lto::check_lto_allowed; | ... | @@ -42,7 +42,7 @@ use crate::back::lto::check_lto_allowed; |
| 42 | use crate::errors::ErrorCreatingRemarkDir; | 42 | use crate::errors::ErrorCreatingRemarkDir; |
| 43 | use crate::traits::*; | 43 | use crate::traits::*; |
| 44 | use crate::{ | 44 | use crate::{ |
| 45 | CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind, | 45 | CachedModuleCodegen, CompiledModule, CompiledModules, CrateInfo, ModuleCodegen, ModuleKind, |
| 46 | errors, | 46 | errors, |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| ... | @@ -394,16 +394,8 @@ fn generate_thin_lto_work<B: ExtraBackendMethods>( | ... | @@ -394,16 +394,8 @@ fn generate_thin_lto_work<B: ExtraBackendMethods>( |
| 394 | .collect() | 394 | .collect() |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | pub struct CompiledModules { | ||
| 398 | pub modules: Vec<CompiledModule>, | ||
| 399 | pub allocator_module: Option<CompiledModule>, | ||
| 400 | } | ||
| 401 | |||
| 402 | enum MaybeLtoModules<B: WriteBackendMethods> { | 397 | enum MaybeLtoModules<B: WriteBackendMethods> { |
| 403 | NoLto { | 398 | NoLto(CompiledModules), |
| 404 | modules: Vec<CompiledModule>, | ||
| 405 | allocator_module: Option<CompiledModule>, | ||
| 406 | }, | ||
| 407 | FatLto { | 399 | FatLto { |
| 408 | cgcx: CodegenContext, | 400 | cgcx: CodegenContext, |
| 409 | exported_symbols_for_lto: Arc<Vec<String>>, | 401 | exported_symbols_for_lto: Arc<Vec<String>>, |
| ... | @@ -443,15 +435,13 @@ fn need_pre_lto_bitcode_for_incr_comp(sess: &Session) -> bool { | ... | @@ -443,15 +435,13 @@ fn need_pre_lto_bitcode_for_incr_comp(sess: &Session) -> bool { |
| 443 | pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( | 435 | pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( |
| 444 | backend: B, | 436 | backend: B, |
| 445 | tcx: TyCtxt<'_>, | 437 | tcx: TyCtxt<'_>, |
| 446 | target_cpu: String, | 438 | crate_info: &CrateInfo, |
| 447 | allocator_module: Option<ModuleCodegen<B::Module>>, | 439 | allocator_module: Option<ModuleCodegen<B::Module>>, |
| 448 | ) -> OngoingCodegen<B> { | 440 | ) -> OngoingCodegen<B> { |
| 449 | let (coordinator_send, coordinator_receive) = channel(); | 441 | let (coordinator_send, coordinator_receive) = channel(); |
| 450 | 442 | ||
| 451 | let no_builtins = find_attr!(tcx, crate, NoBuiltins); | 443 | let no_builtins = find_attr!(tcx, crate, NoBuiltins); |
| 452 | 444 | ||
| 453 | let crate_info = CrateInfo::new(tcx, target_cpu); | ||
| 454 | |||
| 455 | let regular_config = ModuleConfig::new(ModuleKind::Regular, tcx, no_builtins); | 445 | let regular_config = ModuleConfig::new(ModuleKind::Regular, tcx, no_builtins); |
| 456 | let allocator_config = ModuleConfig::new(ModuleKind::Allocator, tcx, no_builtins); | 446 | let allocator_config = ModuleConfig::new(ModuleKind::Allocator, tcx, no_builtins); |
| 457 | 447 | ||
| ... | @@ -461,7 +451,7 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( | ... | @@ -461,7 +451,7 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( |
| 461 | let coordinator_thread = start_executing_work( | 451 | let coordinator_thread = start_executing_work( |
| 462 | backend.clone(), | 452 | backend.clone(), |
| 463 | tcx, | 453 | tcx, |
| 464 | &crate_info, | 454 | crate_info, |
| 465 | shared_emitter, | 455 | shared_emitter, |
| 466 | codegen_worker_send, | 456 | codegen_worker_send, |
| 467 | coordinator_receive, | 457 | coordinator_receive, |
| ... | @@ -473,7 +463,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( | ... | @@ -473,7 +463,6 @@ pub(crate) fn start_async_codegen<B: ExtraBackendMethods>( |
| 473 | 463 | ||
| 474 | OngoingCodegen { | 464 | OngoingCodegen { |
| 475 | backend, | 465 | backend, |
| 476 | crate_info, | ||
| 477 | 466 | ||
| 478 | codegen_worker_receive, | 467 | codegen_worker_receive, |
| 479 | shared_emitter_main, | 468 | shared_emitter_main, |
| ... | @@ -1818,12 +1807,12 @@ fn start_executing_work<B: ExtraBackendMethods>( | ... | @@ -1818,12 +1807,12 @@ fn start_executing_work<B: ExtraBackendMethods>( |
| 1818 | } | 1807 | } |
| 1819 | } | 1808 | } |
| 1820 | 1809 | ||
| 1821 | Ok(MaybeLtoModules::NoLto { | 1810 | Ok(MaybeLtoModules::NoLto(CompiledModules { |
| 1822 | modules: compiled_modules, | 1811 | modules: compiled_modules, |
| 1823 | allocator_module: allocator_module.map(|allocator_module| { | 1812 | allocator_module: allocator_module.map(|allocator_module| { |
| 1824 | B::codegen(&cgcx, &prof, &shared_emitter, allocator_module, &allocator_config) | 1813 | B::codegen(&cgcx, &prof, &shared_emitter, allocator_module, &allocator_config) |
| 1825 | }), | 1814 | }), |
| 1826 | }) | 1815 | })) |
| 1827 | }) | 1816 | }) |
| 1828 | .expect("failed to spawn coordinator thread"); | 1817 | .expect("failed to spawn coordinator thread"); |
| 1829 | 1818 | ||
| ... | @@ -2139,7 +2128,6 @@ impl<B: ExtraBackendMethods> Drop for Coordinator<B> { | ... | @@ -2139,7 +2128,6 @@ impl<B: ExtraBackendMethods> Drop for Coordinator<B> { |
| 2139 | 2128 | ||
| 2140 | pub struct OngoingCodegen<B: ExtraBackendMethods> { | 2129 | pub struct OngoingCodegen<B: ExtraBackendMethods> { |
| 2141 | pub backend: B, | 2130 | pub backend: B, |
| 2142 | pub crate_info: CrateInfo, | ||
| 2143 | pub output_filenames: Arc<OutputFilenames>, | 2131 | pub output_filenames: Arc<OutputFilenames>, |
| 2144 | // Field order below is intended to terminate the coordinator thread before two fields below | 2132 | // Field order below is intended to terminate the coordinator thread before two fields below |
| 2145 | // drop and prematurely close channels used by coordinator thread. See `Coordinator`'s | 2133 | // drop and prematurely close channels used by coordinator thread. See `Coordinator`'s |
| ... | @@ -2150,7 +2138,7 @@ pub struct OngoingCodegen<B: ExtraBackendMethods> { | ... | @@ -2150,7 +2138,7 @@ pub struct OngoingCodegen<B: ExtraBackendMethods> { |
| 2150 | } | 2138 | } |
| 2151 | 2139 | ||
| 2152 | impl<B: ExtraBackendMethods> OngoingCodegen<B> { | 2140 | impl<B: ExtraBackendMethods> OngoingCodegen<B> { |
| 2153 | pub fn join(self, sess: &Session) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 2141 | pub fn join(self, sess: &Session) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 2154 | self.shared_emitter_main.check(sess, true); | 2142 | self.shared_emitter_main.check(sess, true); |
| 2155 | 2143 | ||
| 2156 | let maybe_lto_modules = sess.time("join_worker_thread", || match self.coordinator.join() { | 2144 | let maybe_lto_modules = sess.time("join_worker_thread", || match self.coordinator.join() { |
| ... | @@ -2170,9 +2158,9 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { | ... | @@ -2170,9 +2158,9 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { |
| 2170 | 2158 | ||
| 2171 | // Catch fatal errors to ensure shared_emitter_main.check() can emit the actual diagnostics | 2159 | // Catch fatal errors to ensure shared_emitter_main.check() can emit the actual diagnostics |
| 2172 | let compiled_modules = catch_fatal_errors(|| match maybe_lto_modules { | 2160 | let compiled_modules = catch_fatal_errors(|| match maybe_lto_modules { |
| 2173 | MaybeLtoModules::NoLto { modules, allocator_module } => { | 2161 | MaybeLtoModules::NoLto(compiled_modules) => { |
| 2174 | drop(shared_emitter); | 2162 | drop(shared_emitter); |
| 2175 | CompiledModules { modules, allocator_module } | 2163 | compiled_modules |
| 2176 | } | 2164 | } |
| 2177 | MaybeLtoModules::FatLto { | 2165 | MaybeLtoModules::FatLto { |
| 2178 | cgcx, | 2166 | cgcx, |
| ... | @@ -2256,15 +2244,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { | ... | @@ -2256,15 +2244,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { |
| 2256 | self.backend.print_statistics() | 2244 | self.backend.print_statistics() |
| 2257 | } | 2245 | } |
| 2258 | 2246 | ||
| 2259 | ( | 2247 | (compiled_modules, work_products) |
| 2260 | CodegenResults { | ||
| 2261 | crate_info: self.crate_info, | ||
| 2262 | |||
| 2263 | modules: compiled_modules.modules, | ||
| 2264 | allocator_module: compiled_modules.allocator_module, | ||
| 2265 | }, | ||
| 2266 | work_products, | ||
| 2267 | ) | ||
| 2268 | } | 2248 | } |
| 2269 | 2249 | ||
| 2270 | pub(crate) fn codegen_finished(&self, tcx: TyCtxt<'_>) { | 2250 | pub(crate) fn codegen_finished(&self, tcx: TyCtxt<'_>) { |
compiler/rustc_codegen_ssa/src/base.rs+2-2| ... | @@ -681,7 +681,7 @@ pub fn allocator_shim_contents(tcx: TyCtxt<'_>, kind: AllocatorKind) -> Vec<Allo | ... | @@ -681,7 +681,7 @@ pub fn allocator_shim_contents(tcx: TyCtxt<'_>, kind: AllocatorKind) -> Vec<Allo |
| 681 | pub fn codegen_crate<B: ExtraBackendMethods>( | 681 | pub fn codegen_crate<B: ExtraBackendMethods>( |
| 682 | backend: B, | 682 | backend: B, |
| 683 | tcx: TyCtxt<'_>, | 683 | tcx: TyCtxt<'_>, |
| 684 | target_cpu: String, | 684 | crate_info: &CrateInfo, |
| 685 | ) -> OngoingCodegen<B> { | 685 | ) -> OngoingCodegen<B> { |
| 686 | if tcx.sess.target.need_explicit_cpu && tcx.sess.opts.cg.target_cpu.is_none() { | 686 | if tcx.sess.target.need_explicit_cpu && tcx.sess.opts.cg.target_cpu.is_none() { |
| 687 | // The target has no default cpu, but none is set explicitly | 687 | // The target has no default cpu, but none is set explicitly |
| ... | @@ -719,7 +719,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( | ... | @@ -719,7 +719,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( |
| 719 | None | 719 | None |
| 720 | }; | 720 | }; |
| 721 | 721 | ||
| 722 | let ongoing_codegen = start_async_codegen(backend.clone(), tcx, target_cpu, allocator_module); | 722 | let ongoing_codegen = start_async_codegen(backend.clone(), tcx, crate_info, allocator_module); |
| 723 | 723 | ||
| 724 | // For better throughput during parallel processing by LLVM, we used to sort | 724 | // For better throughput during parallel processing by LLVM, we used to sort |
| 725 | // CGUs largest to smallest. This would lead to better thread utilization | 725 | // CGUs largest to smallest. This would lead to better thread utilization |
compiler/rustc_codegen_ssa/src/lib.rs+12-9| ... | @@ -209,7 +209,8 @@ impl From<&cstore::NativeLib> for NativeLib { | ... | @@ -209,7 +209,8 @@ impl From<&cstore::NativeLib> for NativeLib { |
| 209 | /// identifiers (`CrateNum`) to `CrateSource`. The other fields map `CrateNum` to the crate's own | 209 | /// identifiers (`CrateNum`) to `CrateSource`. The other fields map `CrateNum` to the crate's own |
| 210 | /// additional properties, so that effectively we can retrieve each dependent crate's `CrateSource` | 210 | /// additional properties, so that effectively we can retrieve each dependent crate's `CrateSource` |
| 211 | /// and the corresponding properties without referencing information outside of a `CrateInfo`. | 211 | /// and the corresponding properties without referencing information outside of a `CrateInfo`. |
| 212 | #[derive(Debug, Encodable, Decodable)] | 212 | // rustc_codegen_cranelift needs a Clone impl for its jit mode, which isn't tested in rust CI |
| 213 | #[derive(Clone, Debug, Encodable, Decodable)] | ||
| 213 | pub struct CrateInfo { | 214 | pub struct CrateInfo { |
| 214 | pub target_cpu: String, | 215 | pub target_cpu: String, |
| 215 | pub target_features: Vec<String>, | 216 | pub target_features: Vec<String>, |
| ... | @@ -251,10 +252,9 @@ pub struct TargetConfig { | ... | @@ -251,10 +252,9 @@ pub struct TargetConfig { |
| 251 | } | 252 | } |
| 252 | 253 | ||
| 253 | #[derive(Encodable, Decodable)] | 254 | #[derive(Encodable, Decodable)] |
| 254 | pub struct CodegenResults { | 255 | pub struct CompiledModules { |
| 255 | pub modules: Vec<CompiledModule>, | 256 | pub modules: Vec<CompiledModule>, |
| 256 | pub allocator_module: Option<CompiledModule>, | 257 | pub allocator_module: Option<CompiledModule>, |
| 257 | pub crate_info: CrateInfo, | ||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | pub enum CodegenErrors { | 260 | pub enum CodegenErrors { |
| ... | @@ -293,11 +293,12 @@ pub fn looks_like_rust_object_file(filename: &str) -> bool { | ... | @@ -293,11 +293,12 @@ pub fn looks_like_rust_object_file(filename: &str) -> bool { |
| 293 | const RLINK_VERSION: u32 = 1; | 293 | const RLINK_VERSION: u32 = 1; |
| 294 | const RLINK_MAGIC: &[u8] = b"rustlink"; | 294 | const RLINK_MAGIC: &[u8] = b"rustlink"; |
| 295 | 295 | ||
| 296 | impl CodegenResults { | 296 | impl CompiledModules { |
| 297 | pub fn serialize_rlink( | 297 | pub fn serialize_rlink( |
| 298 | sess: &Session, | 298 | sess: &Session, |
| 299 | rlink_file: &Path, | 299 | rlink_file: &Path, |
| 300 | codegen_results: &CodegenResults, | 300 | compiled_modules: &CompiledModules, |
| 301 | crate_info: &CrateInfo, | ||
| 301 | metadata: &EncodedMetadata, | 302 | metadata: &EncodedMetadata, |
| 302 | outputs: &OutputFilenames, | 303 | outputs: &OutputFilenames, |
| 303 | ) -> Result<usize, io::Error> { | 304 | ) -> Result<usize, io::Error> { |
| ... | @@ -307,7 +308,8 @@ impl CodegenResults { | ... | @@ -307,7 +308,8 @@ impl CodegenResults { |
| 307 | // Encoder's inner representation of `u32`. | 308 | // Encoder's inner representation of `u32`. |
| 308 | encoder.emit_raw_bytes(&RLINK_VERSION.to_be_bytes()); | 309 | encoder.emit_raw_bytes(&RLINK_VERSION.to_be_bytes()); |
| 309 | encoder.emit_str(sess.cfg_version); | 310 | encoder.emit_str(sess.cfg_version); |
| 310 | Encodable::encode(codegen_results, &mut encoder); | 311 | Encodable::encode(compiled_modules, &mut encoder); |
| 312 | Encodable::encode(crate_info, &mut encoder); | ||
| 311 | Encodable::encode(metadata, &mut encoder); | 313 | Encodable::encode(metadata, &mut encoder); |
| 312 | Encodable::encode(outputs, &mut encoder); | 314 | Encodable::encode(outputs, &mut encoder); |
| 313 | encoder.finish().map_err(|(_path, err)| err) | 315 | encoder.finish().map_err(|(_path, err)| err) |
| ... | @@ -316,7 +318,7 @@ impl CodegenResults { | ... | @@ -316,7 +318,7 @@ impl CodegenResults { |
| 316 | pub fn deserialize_rlink( | 318 | pub fn deserialize_rlink( |
| 317 | sess: &Session, | 319 | sess: &Session, |
| 318 | data: Vec<u8>, | 320 | data: Vec<u8>, |
| 319 | ) -> Result<(Self, EncodedMetadata, OutputFilenames), CodegenErrors> { | 321 | ) -> Result<(Self, CrateInfo, EncodedMetadata, OutputFilenames), CodegenErrors> { |
| 320 | // The Decodable machinery is not used here because it panics if the input data is invalid | 322 | // The Decodable machinery is not used here because it panics if the input data is invalid |
| 321 | // and because its internal representation may change. | 323 | // and because its internal representation may change. |
| 322 | if !data.starts_with(RLINK_MAGIC) { | 324 | if !data.starts_with(RLINK_MAGIC) { |
| ... | @@ -346,10 +348,11 @@ impl CodegenResults { | ... | @@ -346,10 +348,11 @@ impl CodegenResults { |
| 346 | }); | 348 | }); |
| 347 | } | 349 | } |
| 348 | 350 | ||
| 349 | let codegen_results = CodegenResults::decode(&mut decoder); | 351 | let compiled_modules = CompiledModules::decode(&mut decoder); |
| 352 | let crate_info = CrateInfo::decode(&mut decoder); | ||
| 350 | let metadata = EncodedMetadata::decode(&mut decoder); | 353 | let metadata = EncodedMetadata::decode(&mut decoder); |
| 351 | let outputs = OutputFilenames::decode(&mut decoder); | 354 | let outputs = OutputFilenames::decode(&mut decoder); |
| 352 | Ok((codegen_results, metadata, outputs)) | 355 | Ok((compiled_modules, crate_info, metadata, outputs)) |
| 353 | } | 356 | } |
| 354 | } | 357 | } |
| 355 | 358 |
compiler/rustc_codegen_ssa/src/traits/backend.rs+10-6| ... | @@ -18,7 +18,7 @@ use super::write::WriteBackendMethods; | ... | @@ -18,7 +18,7 @@ use super::write::WriteBackendMethods; |
| 18 | use crate::back::archive::ArArchiveBuilderBuilder; | 18 | use crate::back::archive::ArArchiveBuilderBuilder; |
| 19 | use crate::back::link::link_binary; | 19 | use crate::back::link::link_binary; |
| 20 | use crate::back::write::TargetMachineFactoryFn; | 20 | use crate::back::write::TargetMachineFactoryFn; |
| 21 | use crate::{CodegenResults, ModuleCodegen, TargetConfig}; | 21 | use crate::{CompiledModules, CrateInfo, ModuleCodegen, TargetConfig}; |
| 22 | 22 | ||
| 23 | pub trait BackendTypes { | 23 | pub trait BackendTypes { |
| 24 | type Function: CodegenObject; | 24 | type Function: CodegenObject; |
| ... | @@ -103,7 +103,9 @@ pub trait CodegenBackend { | ... | @@ -103,7 +103,9 @@ pub trait CodegenBackend { |
| 103 | 103 | ||
| 104 | fn provide(&self, _providers: &mut Providers) {} | 104 | fn provide(&self, _providers: &mut Providers) {} |
| 105 | 105 | ||
| 106 | fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Box<dyn Any>; | 106 | fn target_cpu(&self, sess: &Session) -> String; |
| 107 | |||
| 108 | fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>, crate_info: &CrateInfo) -> Box<dyn Any>; | ||
| 107 | 109 | ||
| 108 | /// This is called on the returned `Box<dyn Any>` from [`codegen_crate`](Self::codegen_crate) | 110 | /// This is called on the returned `Box<dyn Any>` from [`codegen_crate`](Self::codegen_crate) |
| 109 | /// | 111 | /// |
| ... | @@ -115,20 +117,22 @@ pub trait CodegenBackend { | ... | @@ -115,20 +117,22 @@ pub trait CodegenBackend { |
| 115 | ongoing_codegen: Box<dyn Any>, | 117 | ongoing_codegen: Box<dyn Any>, |
| 116 | sess: &Session, | 118 | sess: &Session, |
| 117 | outputs: &OutputFilenames, | 119 | outputs: &OutputFilenames, |
| 118 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>); | 120 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>); |
| 119 | 121 | ||
| 120 | /// This is called on the returned [`CodegenResults`] from [`join_codegen`](Self::join_codegen). | 122 | /// This is called on the returned [`CompiledModules`] from [`join_codegen`](Self::join_codegen). |
| 121 | fn link( | 123 | fn link( |
| 122 | &self, | 124 | &self, |
| 123 | sess: &Session, | 125 | sess: &Session, |
| 124 | codegen_results: CodegenResults, | 126 | compiled_modules: CompiledModules, |
| 127 | crate_info: CrateInfo, | ||
| 125 | metadata: EncodedMetadata, | 128 | metadata: EncodedMetadata, |
| 126 | outputs: &OutputFilenames, | 129 | outputs: &OutputFilenames, |
| 127 | ) { | 130 | ) { |
| 128 | link_binary( | 131 | link_binary( |
| 129 | sess, | 132 | sess, |
| 130 | &ArArchiveBuilderBuilder, | 133 | &ArArchiveBuilderBuilder, |
| 131 | codegen_results, | 134 | compiled_modules, |
| 135 | crate_info, | ||
| 132 | metadata, | 136 | metadata, |
| 133 | outputs, | 137 | outputs, |
| 134 | self.name(), | 138 | self.name(), |
compiler/rustc_driver_impl/src/lib.rs+7-5| ... | @@ -28,7 +28,7 @@ use std::{env, str}; | ... | @@ -28,7 +28,7 @@ use std::{env, str}; |
| 28 | 28 | ||
| 29 | use rustc_ast as ast; | 29 | use rustc_ast as ast; |
| 30 | use rustc_codegen_ssa::traits::CodegenBackend; | 30 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 31 | use rustc_codegen_ssa::{CodegenErrors, CodegenResults}; | 31 | use rustc_codegen_ssa::{CodegenErrors, CompiledModules}; |
| 32 | use rustc_data_structures::profiling::{ | 32 | use rustc_data_structures::profiling::{ |
| 33 | TimePassesFormat, get_resident_set_size, print_time_passes_entry, | 33 | TimePassesFormat, get_resident_set_size, print_time_passes_entry, |
| 34 | }; | 34 | }; |
| ... | @@ -556,9 +556,11 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) { | ... | @@ -556,9 +556,11 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) { |
| 556 | let rlink_data = fs::read(file).unwrap_or_else(|err| { | 556 | let rlink_data = fs::read(file).unwrap_or_else(|err| { |
| 557 | dcx.emit_fatal(RlinkUnableToRead { err }); | 557 | dcx.emit_fatal(RlinkUnableToRead { err }); |
| 558 | }); | 558 | }); |
| 559 | let (codegen_results, metadata, outputs) = | 559 | let (compiled_modules, crate_info, metadata, outputs) = |
| 560 | match CodegenResults::deserialize_rlink(sess, rlink_data) { | 560 | match CompiledModules::deserialize_rlink(sess, rlink_data) { |
| 561 | Ok((codegen, metadata, outputs)) => (codegen, metadata, outputs), | 561 | Ok((codegen, crate_info, metadata, outputs)) => { |
| 562 | (codegen, crate_info, metadata, outputs) | ||
| 563 | } | ||
| 562 | Err(err) => { | 564 | Err(err) => { |
| 563 | match err { | 565 | match err { |
| 564 | CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType), | 566 | CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType), |
| ... | @@ -583,7 +585,7 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) { | ... | @@ -583,7 +585,7 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) { |
| 583 | }; | 585 | }; |
| 584 | } | 586 | } |
| 585 | }; | 587 | }; |
| 586 | compiler.codegen_backend.link(sess, codegen_results, metadata, &outputs); | 588 | compiler.codegen_backend.link(sess, compiled_modules, crate_info, metadata, &outputs); |
| 587 | } else { | 589 | } else { |
| 588 | dcx.emit_fatal(RlinkNotAFile {}); | 590 | dcx.emit_fatal(RlinkNotAFile {}); |
| 589 | } | 591 | } |
compiler/rustc_feature/src/unstable.rs+2| ... | @@ -520,6 +520,8 @@ declare_features! ( | ... | @@ -520,6 +520,8 @@ declare_features! ( |
| 520 | (unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)), | 520 | (unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)), |
| 521 | /// Target features on hexagon. | 521 | /// Target features on hexagon. |
| 522 | (unstable, hexagon_target_feature, "1.27.0", Some(150250)), | 522 | (unstable, hexagon_target_feature, "1.27.0", Some(150250)), |
| 523 | /// Allows `impl(crate) trait Foo` restrictions. | ||
| 524 | (incomplete, impl_restriction, "CURRENT_RUSTC_VERSION", Some(105077)), | ||
| 523 | /// Allows `impl Trait` to be used inside associated types (RFC 2515). | 525 | /// Allows `impl Trait` to be used inside associated types (RFC 2515). |
| 524 | (unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)), | 526 | (unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)), |
| 525 | /// Allows `impl Trait` in bindings (`let`). | 527 | /// Allows `impl Trait` in bindings (`let`). |
compiler/rustc_hir/src/def.rs+1-1| ... | @@ -371,7 +371,7 @@ impl DefKind { | ... | @@ -371,7 +371,7 @@ impl DefKind { |
| 371 | ) | 371 | ) |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | /// Whether the corresponding item has generic parameters, ie. the `generics_of` query works. | 374 | /// Whether the corresponding item has generic parameters, i.e. the `generics_of` query works. |
| 375 | pub fn has_generics(self) -> bool { | 375 | pub fn has_generics(self) -> bool { |
| 376 | match self { | 376 | match self { |
| 377 | DefKind::AnonConst | 377 | DefKind::AnonConst |
compiler/rustc_interface/src/passes.rs+8-10| ... | @@ -8,7 +8,7 @@ use std::{env, fs, iter}; | ... | @@ -8,7 +8,7 @@ use std::{env, fs, iter}; |
| 8 | use rustc_ast::{self as ast, CRATE_NODE_ID}; | 8 | use rustc_ast::{self as ast, CRATE_NODE_ID}; |
| 9 | use rustc_attr_parsing::{AttributeParser, Early, ShouldEmit}; | 9 | use rustc_attr_parsing::{AttributeParser, Early, ShouldEmit}; |
| 10 | use rustc_codegen_ssa::traits::CodegenBackend; | 10 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 11 | use rustc_codegen_ssa::{CodegenResults, CrateInfo}; | 11 | use rustc_codegen_ssa::{CompiledModules, CrateInfo}; |
| 12 | use rustc_data_structures::indexmap::IndexMap; | 12 | use rustc_data_structures::indexmap::IndexMap; |
| 13 | use rustc_data_structures::steal::Steal; | 13 | use rustc_data_structures::steal::Steal; |
| 14 | use rustc_data_structures::sync::{AppendOnlyIndexVec, FreezeLock, WorkerLocal, par_fns}; | 14 | use rustc_data_structures::sync::{AppendOnlyIndexVec, FreezeLock, WorkerLocal, par_fns}; |
| ... | @@ -1194,7 +1194,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) { | ... | @@ -1194,7 +1194,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) { |
| 1194 | pub(crate) fn start_codegen<'tcx>( | 1194 | pub(crate) fn start_codegen<'tcx>( |
| 1195 | codegen_backend: &dyn CodegenBackend, | 1195 | codegen_backend: &dyn CodegenBackend, |
| 1196 | tcx: TyCtxt<'tcx>, | 1196 | tcx: TyCtxt<'tcx>, |
| 1197 | ) -> (Box<dyn Any>, EncodedMetadata) { | 1197 | ) -> (Box<dyn Any>, CrateInfo, EncodedMetadata) { |
| 1198 | tcx.sess.timings.start_section(tcx.sess.dcx(), TimingSection::Codegen); | 1198 | tcx.sess.timings.start_section(tcx.sess.dcx(), TimingSection::Codegen); |
| 1199 | 1199 | ||
| 1200 | // Hook for tests. | 1200 | // Hook for tests. |
| ... | @@ -1221,19 +1221,17 @@ pub(crate) fn start_codegen<'tcx>( | ... | @@ -1221,19 +1221,17 @@ pub(crate) fn start_codegen<'tcx>( |
| 1221 | 1221 | ||
| 1222 | let metadata = rustc_metadata::fs::encode_and_write_metadata(tcx); | 1222 | let metadata = rustc_metadata::fs::encode_and_write_metadata(tcx); |
| 1223 | 1223 | ||
| 1224 | let codegen = tcx.sess.time("codegen_crate", move || { | 1224 | let crate_info = CrateInfo::new(tcx, codegen_backend.target_cpu(tcx.sess)); |
| 1225 | |||
| 1226 | let codegen = tcx.sess.time("codegen_crate", || { | ||
| 1225 | if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() { | 1227 | if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() { |
| 1226 | // Skip crate items and just output metadata in -Z no-codegen mode. | 1228 | // Skip crate items and just output metadata in -Z no-codegen mode. |
| 1227 | tcx.sess.dcx().abort_if_errors(); | 1229 | tcx.sess.dcx().abort_if_errors(); |
| 1228 | 1230 | ||
| 1229 | // Linker::link will skip join_codegen in case of a CodegenResults Any value. | 1231 | // Linker::link will skip join_codegen in case of a CodegenResults Any value. |
| 1230 | Box::new(CodegenResults { | 1232 | Box::new(CompiledModules { modules: vec![], allocator_module: None }) |
| 1231 | modules: vec![], | ||
| 1232 | allocator_module: None, | ||
| 1233 | crate_info: CrateInfo::new(tcx, "<dummy cpu>".to_owned()), | ||
| 1234 | }) | ||
| 1235 | } else { | 1233 | } else { |
| 1236 | codegen_backend.codegen_crate(tcx) | 1234 | codegen_backend.codegen_crate(tcx, &crate_info) |
| 1237 | } | 1235 | } |
| 1238 | }); | 1236 | }); |
| 1239 | 1237 | ||
| ... | @@ -1245,7 +1243,7 @@ pub(crate) fn start_codegen<'tcx>( | ... | @@ -1245,7 +1243,7 @@ pub(crate) fn start_codegen<'tcx>( |
| 1245 | tcx.sess.code_stats.print_type_sizes(); | 1243 | tcx.sess.code_stats.print_type_sizes(); |
| 1246 | } | 1244 | } |
| 1247 | 1245 | ||
| 1248 | (codegen, metadata) | 1246 | (codegen, crate_info, metadata) |
| 1249 | } | 1247 | } |
| 1250 | 1248 | ||
| 1251 | /// Compute and validate the crate name. | 1249 | /// Compute and validate the crate name. |
compiler/rustc_interface/src/queries.rs+17-8| ... | @@ -1,8 +1,8 @@ | ... | @@ -1,8 +1,8 @@ |
| 1 | use std::any::Any; | 1 | use std::any::Any; |
| 2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
| 3 | 3 | ||
| 4 | use rustc_codegen_ssa::CodegenResults; | ||
| 5 | use rustc_codegen_ssa::traits::CodegenBackend; | 4 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 5 | use rustc_codegen_ssa::{CompiledModules, CrateInfo}; | ||
| 6 | use rustc_data_structures::indexmap::IndexMap; | 6 | use rustc_data_structures::indexmap::IndexMap; |
| 7 | use rustc_data_structures::svh::Svh; | 7 | use rustc_data_structures::svh::Svh; |
| 8 | use rustc_errors::timings::TimingSection; | 8 | use rustc_errors::timings::TimingSection; |
| ... | @@ -21,6 +21,7 @@ pub struct Linker { | ... | @@ -21,6 +21,7 @@ pub struct Linker { |
| 21 | output_filenames: Arc<OutputFilenames>, | 21 | output_filenames: Arc<OutputFilenames>, |
| 22 | // Only present when incr. comp. is enabled. | 22 | // Only present when incr. comp. is enabled. |
| 23 | crate_hash: Option<Svh>, | 23 | crate_hash: Option<Svh>, |
| 24 | crate_info: CrateInfo, | ||
| 24 | metadata: EncodedMetadata, | 25 | metadata: EncodedMetadata, |
| 25 | ongoing_codegen: Box<dyn Any>, | 26 | ongoing_codegen: Box<dyn Any>, |
| 26 | } | 27 | } |
| ... | @@ -30,7 +31,7 @@ impl Linker { | ... | @@ -30,7 +31,7 @@ impl Linker { |
| 30 | tcx: TyCtxt<'_>, | 31 | tcx: TyCtxt<'_>, |
| 31 | codegen_backend: &dyn CodegenBackend, | 32 | codegen_backend: &dyn CodegenBackend, |
| 32 | ) -> Linker { | 33 | ) -> Linker { |
| 33 | let (ongoing_codegen, metadata) = passes::start_codegen(codegen_backend, tcx); | 34 | let (ongoing_codegen, crate_info, metadata) = passes::start_codegen(codegen_backend, tcx); |
| 34 | 35 | ||
| 35 | Linker { | 36 | Linker { |
| 36 | dep_graph: tcx.dep_graph.clone(), | 37 | dep_graph: tcx.dep_graph.clone(), |
| ... | @@ -40,16 +41,17 @@ impl Linker { | ... | @@ -40,16 +41,17 @@ impl Linker { |
| 40 | } else { | 41 | } else { |
| 41 | None | 42 | None |
| 42 | }, | 43 | }, |
| 44 | crate_info, | ||
| 43 | metadata, | 45 | metadata, |
| 44 | ongoing_codegen, | 46 | ongoing_codegen, |
| 45 | } | 47 | } |
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | pub fn link(self, sess: &Session, codegen_backend: &dyn CodegenBackend) { | 50 | pub fn link(self, sess: &Session, codegen_backend: &dyn CodegenBackend) { |
| 49 | let (codegen_results, mut work_products) = sess.time("finish_ongoing_codegen", || { | 51 | let (compiled_modules, mut work_products) = sess.time("finish_ongoing_codegen", || { |
| 50 | match self.ongoing_codegen.downcast::<CodegenResults>() { | 52 | match self.ongoing_codegen.downcast::<CompiledModules>() { |
| 51 | // This was a check only build | 53 | // This was a check only build |
| 52 | Ok(codegen_results) => (*codegen_results, IndexMap::default()), | 54 | Ok(compiled_modules) => (*compiled_modules, IndexMap::default()), |
| 53 | 55 | ||
| 54 | Err(ongoing_codegen) => { | 56 | Err(ongoing_codegen) => { |
| 55 | codegen_backend.join_codegen(ongoing_codegen, sess, &self.output_filenames) | 57 | codegen_backend.join_codegen(ongoing_codegen, sess, &self.output_filenames) |
| ... | @@ -97,10 +99,11 @@ impl Linker { | ... | @@ -97,10 +99,11 @@ impl Linker { |
| 97 | 99 | ||
| 98 | if sess.opts.unstable_opts.no_link { | 100 | if sess.opts.unstable_opts.no_link { |
| 99 | let rlink_file = self.output_filenames.with_extension(config::RLINK_EXT); | 101 | let rlink_file = self.output_filenames.with_extension(config::RLINK_EXT); |
| 100 | CodegenResults::serialize_rlink( | 102 | CompiledModules::serialize_rlink( |
| 101 | sess, | 103 | sess, |
| 102 | &rlink_file, | 104 | &rlink_file, |
| 103 | &codegen_results, | 105 | &compiled_modules, |
| 106 | &self.crate_info, | ||
| 104 | &self.metadata, | 107 | &self.metadata, |
| 105 | &self.output_filenames, | 108 | &self.output_filenames, |
| 106 | ) | 109 | ) |
| ... | @@ -112,6 +115,12 @@ impl Linker { | ... | @@ -112,6 +115,12 @@ impl Linker { |
| 112 | 115 | ||
| 113 | let _timer = sess.prof.verbose_generic_activity("link_crate"); | 116 | let _timer = sess.prof.verbose_generic_activity("link_crate"); |
| 114 | let _timing = sess.timings.section_guard(sess.dcx(), TimingSection::Linking); | 117 | let _timing = sess.timings.section_guard(sess.dcx(), TimingSection::Linking); |
| 115 | codegen_backend.link(sess, codegen_results, self.metadata, &self.output_filenames) | 118 | codegen_backend.link( |
| 119 | sess, | ||
| 120 | compiled_modules, | ||
| 121 | self.crate_info, | ||
| 122 | self.metadata, | ||
| 123 | &self.output_filenames, | ||
| 124 | ) | ||
| 116 | } | 125 | } |
| 117 | } | 126 | } |
compiler/rustc_interface/src/util.rs+14-15| ... | @@ -11,7 +11,7 @@ use rustc_codegen_ssa::back::archive::{ArArchiveBuilderBuilder, ArchiveBuilderBu | ... | @@ -11,7 +11,7 @@ use rustc_codegen_ssa::back::archive::{ArArchiveBuilderBuilder, ArchiveBuilderBu |
| 11 | use rustc_codegen_ssa::back::link::link_binary; | 11 | use rustc_codegen_ssa::back::link::link_binary; |
| 12 | use rustc_codegen_ssa::target_features::cfg_target_feature; | 12 | use rustc_codegen_ssa::target_features::cfg_target_feature; |
| 13 | use rustc_codegen_ssa::traits::CodegenBackend; | 13 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 14 | use rustc_codegen_ssa::{CodegenResults, CrateInfo, TargetConfig}; | 14 | use rustc_codegen_ssa::{CompiledModules, CrateInfo, TargetConfig}; |
| 15 | use rustc_data_structures::fx::FxIndexMap; | 15 | use rustc_data_structures::fx::FxIndexMap; |
| 16 | use rustc_data_structures::jobserver::Proxy; | 16 | use rustc_data_structures::jobserver::Proxy; |
| 17 | use rustc_data_structures::sync; | 17 | use rustc_data_structures::sync; |
| ... | @@ -401,12 +401,12 @@ impl CodegenBackend for DummyCodegenBackend { | ... | @@ -401,12 +401,12 @@ impl CodegenBackend for DummyCodegenBackend { |
| 401 | vec![CrateType::Rlib, CrateType::Executable] | 401 | vec![CrateType::Rlib, CrateType::Executable] |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Box<dyn Any> { | 404 | fn target_cpu(&self, _sess: &Session) -> String { |
| 405 | Box::new(CodegenResults { | 405 | String::new() |
| 406 | modules: vec![], | 406 | } |
| 407 | allocator_module: None, | 407 | |
| 408 | crate_info: CrateInfo::new(tcx, String::new()), | 408 | fn codegen_crate<'tcx>(&self, _tcx: TyCtxt<'tcx>, _crate_info: &CrateInfo) -> Box<dyn Any> { |
| 409 | }) | 409 | Box::new(CompiledModules { modules: vec![], allocator_module: None }) |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | fn join_codegen( | 412 | fn join_codegen( |
| ... | @@ -414,24 +414,22 @@ impl CodegenBackend for DummyCodegenBackend { | ... | @@ -414,24 +414,22 @@ impl CodegenBackend for DummyCodegenBackend { |
| 414 | ongoing_codegen: Box<dyn Any>, | 414 | ongoing_codegen: Box<dyn Any>, |
| 415 | _sess: &Session, | 415 | _sess: &Session, |
| 416 | _outputs: &OutputFilenames, | 416 | _outputs: &OutputFilenames, |
| 417 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 417 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 418 | (*ongoing_codegen.downcast().unwrap(), FxIndexMap::default()) | 418 | (*ongoing_codegen.downcast().unwrap(), FxIndexMap::default()) |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | fn link( | 421 | fn link( |
| 422 | &self, | 422 | &self, |
| 423 | sess: &Session, | 423 | sess: &Session, |
| 424 | codegen_results: CodegenResults, | 424 | compiled_modules: CompiledModules, |
| 425 | crate_info: CrateInfo, | ||
| 425 | metadata: EncodedMetadata, | 426 | metadata: EncodedMetadata, |
| 426 | outputs: &OutputFilenames, | 427 | outputs: &OutputFilenames, |
| 427 | ) { | 428 | ) { |
| 428 | // JUSTIFICATION: TyCtxt no longer available here | 429 | // JUSTIFICATION: TyCtxt no longer available here |
| 429 | #[allow(rustc::bad_opt_access)] | 430 | #[allow(rustc::bad_opt_access)] |
| 430 | if let Some(&crate_type) = codegen_results | 431 | if let Some(&crate_type) = |
| 431 | .crate_info | 432 | crate_info.crate_types.iter().find(|&&crate_type| crate_type != CrateType::Rlib) |
| 432 | .crate_types | ||
| 433 | .iter() | ||
| 434 | .find(|&&crate_type| crate_type != CrateType::Rlib) | ||
| 435 | && outputs.outputs.should_link() | 433 | && outputs.outputs.should_link() |
| 436 | { | 434 | { |
| 437 | sess.dcx().fatal(format!( | 435 | sess.dcx().fatal(format!( |
| ... | @@ -442,7 +440,8 @@ impl CodegenBackend for DummyCodegenBackend { | ... | @@ -442,7 +440,8 @@ impl CodegenBackend for DummyCodegenBackend { |
| 442 | link_binary( | 440 | link_binary( |
| 443 | sess, | 441 | sess, |
| 444 | &DummyArchiveBuilderBuilder, | 442 | &DummyArchiveBuilderBuilder, |
| 445 | codegen_results, | 443 | compiled_modules, |
| 444 | crate_info, | ||
| 446 | metadata, | 445 | metadata, |
| 447 | outputs, | 446 | outputs, |
| 448 | self.name(), | 447 | self.name(), |
compiler/rustc_lint/src/ptr_nulls.rs+1-1| ... | @@ -59,7 +59,7 @@ declare_lint! { | ... | @@ -59,7 +59,7 @@ declare_lint! { |
| 59 | declare_lint_pass!(PtrNullChecks => [USELESS_PTR_NULL_CHECKS, INVALID_NULL_ARGUMENTS]); | 59 | declare_lint_pass!(PtrNullChecks => [USELESS_PTR_NULL_CHECKS, INVALID_NULL_ARGUMENTS]); |
| 60 | 60 | ||
| 61 | /// This function checks if the expression is from a series of consecutive casts, | 61 | /// This function checks if the expression is from a series of consecutive casts, |
| 62 | /// ie. `(my_fn as *const _ as *mut _).cast_mut()` and whether the original expression is either | 62 | /// i.e. `(my_fn as *const _ as *mut _).cast_mut()` and whether the original expression is either |
| 63 | /// a fn ptr, a reference, or a function call whose definition is | 63 | /// a fn ptr, a reference, or a function call whose definition is |
| 64 | /// annotated with `#![rustc_never_returns_null_ptr]`. | 64 | /// annotated with `#![rustc_never_returns_null_ptr]`. |
| 65 | /// If this situation is present, the function returns the appropriate diagnostic. | 65 | /// If this situation is present, the function returns the appropriate diagnostic. |
compiler/rustc_macros/src/query.rs+74-81| ... | @@ -137,54 +137,23 @@ struct CacheOnDiskIf { | ... | @@ -137,54 +137,23 @@ struct CacheOnDiskIf { |
| 137 | block: Block, | 137 | block: Block, |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | /// See `rustc_middle::query::modifiers` for documentation of each query modifier. | ||
| 140 | struct QueryModifiers { | 141 | struct QueryModifiers { |
| 141 | /// The description of the query. | 142 | // tidy-alphabetical-start |
| 142 | desc: Desc, | 143 | anon: Option<Ident>, |
| 143 | |||
| 144 | /// Use this type for the in-memory cache. | ||
| 145 | arena_cache: Option<Ident>, | 144 | arena_cache: Option<Ident>, |
| 146 | |||
| 147 | /// Cache the query to disk if the `Block` returns true. | ||
| 148 | cache_on_disk_if: Option<CacheOnDiskIf>, | 145 | cache_on_disk_if: Option<CacheOnDiskIf>, |
| 149 | |||
| 150 | /// A cycle error for this query aborting the compilation with a fatal error. | ||
| 151 | cycle_fatal: Option<Ident>, | ||
| 152 | |||
| 153 | /// A cycle error results in a delay_bug call | ||
| 154 | cycle_delay_bug: Option<Ident>, | 146 | cycle_delay_bug: Option<Ident>, |
| 155 | 147 | cycle_fatal: Option<Ident>, | |
| 156 | /// A cycle error results in a stashed cycle error that can be unstashed and canceled later | ||
| 157 | cycle_stash: Option<Ident>, | 148 | cycle_stash: Option<Ident>, |
| 158 | |||
| 159 | /// Don't hash the result, instead just mark a query red if it runs | ||
| 160 | no_hash: Option<Ident>, | ||
| 161 | |||
| 162 | /// Generate a dep node based on the dependencies of the query | ||
| 163 | anon: Option<Ident>, | ||
| 164 | |||
| 165 | /// Always evaluate the query, ignoring its dependencies | ||
| 166 | eval_always: Option<Ident>, | ||
| 167 | |||
| 168 | /// Whether the query has a call depth limit | ||
| 169 | depth_limit: Option<Ident>, | 149 | depth_limit: Option<Ident>, |
| 170 | 150 | desc: Desc, | |
| 171 | /// Use a separate query provider for local and extern crates | 151 | eval_always: Option<Ident>, |
| 172 | separate_provide_extern: Option<Ident>, | ||
| 173 | |||
| 174 | /// Generate a `feed` method to set the query's value from another query. | ||
| 175 | feedable: Option<Ident>, | 152 | feedable: Option<Ident>, |
| 176 | 153 | no_hash: Option<Ident>, | |
| 177 | /// When this query is called via `tcx.ensure_ok()`, it returns | ||
| 178 | /// `Result<(), ErrorGuaranteed>` instead of `()`. If the query needs to | ||
| 179 | /// be executed, and that execution returns an error, the error result is | ||
| 180 | /// returned to the caller. | ||
| 181 | /// | ||
| 182 | /// If execution is skipped, a synthetic `Ok(())` is returned, on the | ||
| 183 | /// assumption that a query with all-green inputs must have succeeded. | ||
| 184 | /// | ||
| 185 | /// Can only be applied to queries with a return value of | ||
| 186 | /// `Result<_, ErrorGuaranteed>`. | ||
| 187 | return_result_from_ensure_ok: Option<Ident>, | 154 | return_result_from_ensure_ok: Option<Ident>, |
| 155 | separate_provide_extern: Option<Ident>, | ||
| 156 | // tidy-alphabetical-end | ||
| 188 | } | 157 | } |
| 189 | 158 | ||
| 190 | fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { | 159 | fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { |
| ... | @@ -272,6 +241,68 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { | ... | @@ -272,6 +241,68 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { |
| 272 | }) | 241 | }) |
| 273 | } | 242 | } |
| 274 | 243 | ||
| 244 | fn make_modifiers_stream(query: &Query, modifiers: &QueryModifiers) -> proc_macro2::TokenStream { | ||
| 245 | let QueryModifiers { | ||
| 246 | // tidy-alphabetical-start | ||
| 247 | anon, | ||
| 248 | arena_cache, | ||
| 249 | cache_on_disk_if, | ||
| 250 | cycle_delay_bug, | ||
| 251 | cycle_fatal, | ||
| 252 | cycle_stash, | ||
| 253 | depth_limit, | ||
| 254 | desc: _, | ||
| 255 | eval_always, | ||
| 256 | feedable, | ||
| 257 | no_hash, | ||
| 258 | return_result_from_ensure_ok, | ||
| 259 | separate_provide_extern, | ||
| 260 | // tidy-alphabetical-end | ||
| 261 | } = modifiers; | ||
| 262 | |||
| 263 | let anon = anon.is_some(); | ||
| 264 | let arena_cache = arena_cache.is_some(); | ||
| 265 | let cache_on_disk = cache_on_disk_if.is_some(); | ||
| 266 | |||
| 267 | let cycle_error_handling = if cycle_delay_bug.is_some() { | ||
| 268 | quote! { DelayBug } | ||
| 269 | } else if cycle_fatal.is_some() { | ||
| 270 | quote! { Fatal } | ||
| 271 | } else if cycle_stash.is_some() { | ||
| 272 | quote! { Stash } | ||
| 273 | } else { | ||
| 274 | quote! { Error } | ||
| 275 | }; | ||
| 276 | |||
| 277 | let depth_limit = depth_limit.is_some(); | ||
| 278 | let eval_always = eval_always.is_some(); | ||
| 279 | let feedable = feedable.is_some(); | ||
| 280 | let no_hash = no_hash.is_some(); | ||
| 281 | let return_result_from_ensure_ok = return_result_from_ensure_ok.is_some(); | ||
| 282 | let separate_provide_extern = separate_provide_extern.is_some(); | ||
| 283 | |||
| 284 | // Giving an input span to the modifier names in the modifier list seems | ||
| 285 | // to give slightly more helpful errors when one of the callback macros | ||
| 286 | // fails to parse the modifier list. | ||
| 287 | let query_name_span = query.name.span(); | ||
| 288 | quote_spanned! { | ||
| 289 | query_name_span => | ||
| 290 | // Search for (QMODLIST) to find all occurrences of this query modifier list. | ||
| 291 | // tidy-alphabetical-start | ||
| 292 | anon: #anon, | ||
| 293 | arena_cache: #arena_cache, | ||
| 294 | cache_on_disk: #cache_on_disk, | ||
| 295 | cycle_error_handling: #cycle_error_handling, | ||
| 296 | depth_limit: #depth_limit, | ||
| 297 | eval_always: #eval_always, | ||
| 298 | feedable: #feedable, | ||
| 299 | no_hash: #no_hash, | ||
| 300 | return_result_from_ensure_ok: #return_result_from_ensure_ok, | ||
| 301 | separate_provide_extern: #separate_provide_extern, | ||
| 302 | // tidy-alphabetical-end | ||
| 303 | } | ||
| 304 | } | ||
| 305 | |||
| 275 | fn doc_comment_from_desc(list: &Punctuated<Expr, token::Comma>) -> Result<Attribute> { | 306 | fn doc_comment_from_desc(list: &Punctuated<Expr, token::Comma>) -> Result<Attribute> { |
| 276 | use ::syn::*; | 307 | use ::syn::*; |
| 277 | let mut iter = list.iter(); | 308 | let mut iter = list.iter(); |
| ... | @@ -458,51 +489,13 @@ pub(super) fn rustc_queries(input: TokenStream) -> TokenStream { | ... | @@ -458,51 +489,13 @@ pub(super) fn rustc_queries(input: TokenStream) -> TokenStream { |
| 458 | ReturnType::Type(..) => quote! { #return_ty }, | 489 | ReturnType::Type(..) => quote! { #return_ty }, |
| 459 | }; | 490 | }; |
| 460 | 491 | ||
| 461 | let mut modifiers_out = vec![]; | 492 | let modifiers_stream = make_modifiers_stream(&query, modifiers); |
| 462 | |||
| 463 | macro_rules! passthrough { | ||
| 464 | ( $( $modifier:ident ),+ $(,)? ) => { | ||
| 465 | $( if let Some($modifier) = &modifiers.$modifier { | ||
| 466 | modifiers_out.push(quote! { (#$modifier) }); | ||
| 467 | }; )+ | ||
| 468 | } | ||
| 469 | } | ||
| 470 | |||
| 471 | passthrough!( | ||
| 472 | arena_cache, | ||
| 473 | cycle_fatal, | ||
| 474 | cycle_delay_bug, | ||
| 475 | cycle_stash, | ||
| 476 | no_hash, | ||
| 477 | anon, | ||
| 478 | eval_always, | ||
| 479 | feedable, | ||
| 480 | depth_limit, | ||
| 481 | separate_provide_extern, | ||
| 482 | return_result_from_ensure_ok, | ||
| 483 | ); | ||
| 484 | |||
| 485 | // If there was a `cache_on_disk_if` modifier in the real input, pass | ||
| 486 | // on a synthetic `(cache_on_disk)` modifier that can be inspected by | ||
| 487 | // macro-rules macros. | ||
| 488 | if modifiers.cache_on_disk_if.is_some() { | ||
| 489 | modifiers_out.push(quote! { (cache_on_disk) }); | ||
| 490 | } | ||
| 491 | |||
| 492 | // This uses the span of the query definition for the commas, | ||
| 493 | // which can be important if we later encounter any ambiguity | ||
| 494 | // errors with any of the numerous macro_rules! macros that | ||
| 495 | // we use. Using the call-site span would result in a span pointing | ||
| 496 | // at the entire `rustc_queries!` invocation, which wouldn't | ||
| 497 | // be very useful. | ||
| 498 | let span = name.span(); | ||
| 499 | let modifiers_stream = quote_spanned! { span => #(#modifiers_out),* }; | ||
| 500 | 493 | ||
| 501 | // Add the query to the group | 494 | // Add the query to the group |
| 502 | query_stream.extend(quote! { | 495 | query_stream.extend(quote! { |
| 503 | #(#doc_comments)* | 496 | #(#doc_comments)* |
| 504 | [#modifiers_stream] | 497 | fn #name(#key_ty) #return_ty |
| 505 | fn #name(#key_ty) #return_ty, | 498 | { #modifiers_stream } |
| 506 | }); | 499 | }); |
| 507 | 500 | ||
| 508 | if let Some(feedable) = &modifiers.feedable { | 501 | if let Some(feedable) = &modifiers.feedable { |
compiler/rustc_middle/src/dep_graph/dep_node.rs+4-2| ... | @@ -268,8 +268,10 @@ macro_rules! define_dep_nodes { | ... | @@ -268,8 +268,10 @@ macro_rules! define_dep_nodes { |
| 268 | queries { | 268 | queries { |
| 269 | $( | 269 | $( |
| 270 | $(#[$q_attr:meta])* | 270 | $(#[$q_attr:meta])* |
| 271 | [$($modifiers:tt)*] | 271 | fn $q_name:ident($K:ty) -> $V:ty |
| 272 | fn $q_name:ident($K:ty) -> $V:ty, | 272 | // Search for (QMODLIST) to find all occurrences of this query modifier list. |
| 273 | // Query modifiers are currently not used here, so skip the whole list. | ||
| 274 | { $($modifiers:tt)* } | ||
| 273 | )* | 275 | )* |
| 274 | } | 276 | } |
| 275 | non_queries { | 277 | non_queries { |
compiler/rustc_middle/src/query/plumbing.rs+94-118| ... | @@ -333,44 +333,6 @@ macro_rules! query_helper_param_ty { | ... | @@ -333,44 +333,6 @@ macro_rules! query_helper_param_ty { |
| 333 | ($K:ty) => { $K }; | 333 | ($K:ty) => { $K }; |
| 334 | } | 334 | } |
| 335 | 335 | ||
| 336 | // Expands to `$yes` if the `arena_cache` modifier is present, `$no` otherwise. | ||
| 337 | macro_rules! if_arena_cache { | ||
| 338 | ([] $then:tt $no:tt) => { $no }; | ||
| 339 | ([(arena_cache) $($modifiers:tt)*] $yes:tt $no:tt) => { $yes }; | ||
| 340 | ([$other:tt $($modifiers:tt)*] $yes:tt $no:tt) => { | ||
| 341 | if_arena_cache!([$($modifiers)*] $yes $no) | ||
| 342 | }; | ||
| 343 | } | ||
| 344 | |||
| 345 | // Expands to `$yes` if the `separate_provide_extern` modifier is present, `$no` otherwise. | ||
| 346 | macro_rules! if_separate_provide_extern { | ||
| 347 | ([] $then:tt $no:tt) => { $no }; | ||
| 348 | ([(separate_provide_extern) $($modifiers:tt)*] $yes:tt $no:tt) => { $yes }; | ||
| 349 | ([$other:tt $($modifiers:tt)*] $yes:tt $no:tt) => { | ||
| 350 | if_separate_provide_extern!([$($modifiers)*] $yes $no) | ||
| 351 | }; | ||
| 352 | } | ||
| 353 | |||
| 354 | // Expands to `$yes` if the `return_result_from_ensure_ok` modifier is present, `$no` otherwise. | ||
| 355 | macro_rules! if_return_result_from_ensure_ok { | ||
| 356 | ([] $then:tt $no:tt) => { $no }; | ||
| 357 | ([(return_result_from_ensure_ok) $($modifiers:tt)*] $yes:tt $no:tt) => { $yes }; | ||
| 358 | ([$other:tt $($modifiers:tt)*] $yes:tt $no:tt) => { | ||
| 359 | if_return_result_from_ensure_ok!([$($modifiers)*] $yes $no) | ||
| 360 | }; | ||
| 361 | } | ||
| 362 | |||
| 363 | // Expands to `$item` if the `feedable` modifier is present. | ||
| 364 | macro_rules! item_if_feedable { | ||
| 365 | ([] $($item:tt)*) => {}; | ||
| 366 | ([(feedable) $($rest:tt)*] $($item:tt)*) => { | ||
| 367 | $($item)* | ||
| 368 | }; | ||
| 369 | ([$other:tt $($modifiers:tt)*] $($item:tt)*) => { | ||
| 370 | item_if_feedable! { [$($modifiers)*] $($item)* } | ||
| 371 | }; | ||
| 372 | } | ||
| 373 | |||
| 374 | macro_rules! define_callbacks { | 336 | macro_rules! define_callbacks { |
| 375 | ( | 337 | ( |
| 376 | // You might expect the key to be `$K:ty`, but it needs to be `$($K:tt)*` so that | 338 | // You might expect the key to be `$K:ty`, but it needs to be `$($K:tt)*` so that |
| ... | @@ -378,8 +340,20 @@ macro_rules! define_callbacks { | ... | @@ -378,8 +340,20 @@ macro_rules! define_callbacks { |
| 378 | queries { | 340 | queries { |
| 379 | $( | 341 | $( |
| 380 | $(#[$attr:meta])* | 342 | $(#[$attr:meta])* |
| 381 | [$($modifiers:tt)*] | 343 | fn $name:ident($($K:tt)*) -> $V:ty |
| 382 | fn $name:ident($($K:tt)*) -> $V:ty, | 344 | { |
| 345 | // Search for (QMODLIST) to find all occurrences of this query modifier list. | ||
| 346 | anon: $anon:literal, | ||
| 347 | arena_cache: $arena_cache:literal, | ||
| 348 | cache_on_disk: $cache_on_disk:literal, | ||
| 349 | cycle_error_handling: $cycle_error_handling:ident, | ||
| 350 | depth_limit: $depth_limit:literal, | ||
| 351 | eval_always: $eval_always:literal, | ||
| 352 | feedable: $feedable:literal, | ||
| 353 | no_hash: $no_hash:literal, | ||
| 354 | return_result_from_ensure_ok: $return_result_from_ensure_ok:literal, | ||
| 355 | separate_provide_extern: $separate_provide_extern:literal, | ||
| 356 | } | ||
| 383 | )* | 357 | )* |
| 384 | } | 358 | } |
| 385 | // Non-queries are unused here. | 359 | // Non-queries are unused here. |
| ... | @@ -394,20 +368,31 @@ macro_rules! define_callbacks { | ... | @@ -394,20 +368,31 @@ macro_rules! define_callbacks { |
| 394 | pub type Key<'tcx> = $($K)*; | 368 | pub type Key<'tcx> = $($K)*; |
| 395 | pub type Value<'tcx> = $V; | 369 | pub type Value<'tcx> = $V; |
| 396 | 370 | ||
| 397 | pub type LocalKey<'tcx> = if_separate_provide_extern!( | 371 | /// Key type used by provider functions in `local_providers`. |
| 398 | [$($modifiers)*] | 372 | /// This query has the `separate_provide_extern` modifier. |
| 399 | (<Key<'tcx> as $crate::query::AsLocalQueryKey>::LocalQueryKey) | 373 | #[cfg($separate_provide_extern)] |
| 400 | (Key<'tcx>) | 374 | pub type LocalKey<'tcx> = |
| 401 | ); | 375 | <Key<'tcx> as $crate::query::AsLocalQueryKey>::LocalQueryKey; |
| 402 | 376 | /// Key type used by provider functions in `local_providers`. | |
| 403 | /// This type alias specifies the type returned from query providers and the type | 377 | #[cfg(not($separate_provide_extern))] |
| 404 | /// used for decoding. For regular queries this is the declared returned type `V`, | 378 | pub type LocalKey<'tcx> = Key<'tcx>; |
| 405 | /// but `arena_cache` will use `<V as ArenaCached>::Provided` instead. | 379 | |
| 406 | pub type ProvidedValue<'tcx> = if_arena_cache!( | 380 | /// Return type of the `.ensure_ok()` method for this query, |
| 407 | [$($modifiers)*] | 381 | /// which has the `return_result_from_ensure_ok` modifier. |
| 408 | (<Value<'tcx> as $crate::query::arena_cached::ArenaCached<'tcx>>::Provided) | 382 | #[cfg($return_result_from_ensure_ok)] |
| 409 | (Value<'tcx>) | 383 | pub type EnsureOkReturnType = Result<(), rustc_errors::ErrorGuaranteed>; |
| 410 | ); | 384 | /// Return type of the `.ensure_ok()` method for this query, |
| 385 | /// which does _not_ have the `return_result_from_ensure_ok` modifier. | ||
| 386 | #[cfg(not($return_result_from_ensure_ok))] | ||
| 387 | pub type EnsureOkReturnType = (); | ||
| 388 | |||
| 389 | /// Type returned from query providers and loaded from disk-cache. | ||
| 390 | #[cfg($arena_cache)] | ||
| 391 | pub type ProvidedValue<'tcx> = | ||
| 392 | <Value<'tcx> as $crate::query::arena_cached::ArenaCached<'tcx>>::Provided; | ||
| 393 | /// Type returned from query providers and loaded from disk-cache. | ||
| 394 | #[cfg(not($arena_cache))] | ||
| 395 | pub type ProvidedValue<'tcx> = Value<'tcx>; | ||
| 411 | 396 | ||
| 412 | /// This helper function takes a value returned by the query provider | 397 | /// This helper function takes a value returned by the query provider |
| 413 | /// (or loaded from disk, or supplied by query feeding), allocates | 398 | /// (or loaded from disk, or supplied by query feeding), allocates |
| ... | @@ -420,23 +405,23 @@ macro_rules! define_callbacks { | ... | @@ -420,23 +405,23 @@ macro_rules! define_callbacks { |
| 420 | ) -> Erased<Value<'tcx>> { | 405 | ) -> Erased<Value<'tcx>> { |
| 421 | // For queries with the `arena_cache` modifier, store the | 406 | // For queries with the `arena_cache` modifier, store the |
| 422 | // provided value in an arena and get a reference to it. | 407 | // provided value in an arena and get a reference to it. |
| 423 | let value: Value<'tcx> = if_arena_cache!( | 408 | #[cfg($arena_cache)] |
| 424 | [$($modifiers)*] | 409 | let value: Value<'tcx> = { |
| 425 | { | 410 | use $crate::query::arena_cached::ArenaCached; |
| 426 | <Value<'tcx> as $crate::query::arena_cached::ArenaCached>:: | 411 | <Value<'tcx> as ArenaCached>::alloc_in_arena( |
| 427 | alloc_in_arena | 412 | tcx, |
| 428 | ( | 413 | &tcx.query_system.arenas.$name, |
| 429 | tcx, | 414 | provided_value, |
| 430 | &tcx.query_system.arenas.$name, | 415 | ) |
| 431 | provided_value, | 416 | }; |
| 432 | ) | 417 | |
| 433 | } | 418 | // Otherwise, the provided value is the value (and `tcx` is unused). |
| 434 | { | 419 | #[cfg(not($arena_cache))] |
| 435 | // Otherwise, the provided value is the value (and `tcx` is unused). | 420 | let value: Value<'tcx> = { |
| 436 | let _ = tcx; | 421 | let _ = tcx; |
| 437 | provided_value | 422 | provided_value |
| 438 | } | 423 | }; |
| 439 | ); | 424 | |
| 440 | erase::erase_val(value) | 425 | erase::erase_val(value) |
| 441 | } | 426 | } |
| 442 | 427 | ||
| ... | @@ -480,13 +465,11 @@ macro_rules! define_callbacks { | ... | @@ -480,13 +465,11 @@ macro_rules! define_callbacks { |
| 480 | #[derive(Default)] | 465 | #[derive(Default)] |
| 481 | pub struct QueryArenas<'tcx> { | 466 | pub struct QueryArenas<'tcx> { |
| 482 | $( | 467 | $( |
| 483 | pub $name: if_arena_cache!( | 468 | // Use the `ArenaCached` helper trait to determine the arena's value type. |
| 484 | [$($modifiers)*] | 469 | #[cfg($arena_cache)] |
| 485 | // Use the `ArenaCached` helper trait to determine the arena's value type. | 470 | pub $name: TypedArena< |
| 486 | (TypedArena<<$V as $crate::query::arena_cached::ArenaCached<'tcx>>::Allocated>) | 471 | <$V as $crate::query::arena_cached::ArenaCached<'tcx>>::Allocated, |
| 487 | // No arena for this query, so the field type is `()`. | 472 | >, |
| 488 | () | ||
| 489 | ), | ||
| 490 | )* | 473 | )* |
| 491 | } | 474 | } |
| 492 | 475 | ||
| ... | @@ -497,16 +480,14 @@ macro_rules! define_callbacks { | ... | @@ -497,16 +480,14 @@ macro_rules! define_callbacks { |
| 497 | pub fn $name( | 480 | pub fn $name( |
| 498 | self, | 481 | self, |
| 499 | key: query_helper_param_ty!($($K)*), | 482 | key: query_helper_param_ty!($($K)*), |
| 500 | ) -> if_return_result_from_ensure_ok!( | 483 | ) -> $crate::queries::$name::EnsureOkReturnType { |
| 501 | [$($modifiers)*] | 484 | |
| 502 | (Result<(), ErrorGuaranteed>) | 485 | #[cfg($return_result_from_ensure_ok)] |
| 503 | () | 486 | let ensure_fn = crate::query::inner::query_ensure_error_guaranteed; |
| 504 | ) { | 487 | #[cfg(not($return_result_from_ensure_ok))] |
| 505 | if_return_result_from_ensure_ok!( | 488 | let ensure_fn = crate::query::inner::query_ensure; |
| 506 | [$($modifiers)*] | 489 | |
| 507 | (crate::query::inner::query_ensure_error_guaranteed) | 490 | ensure_fn( |
| 508 | (crate::query::inner::query_ensure) | ||
| 509 | )( | ||
| 510 | self.tcx, | 491 | self.tcx, |
| 511 | &self.tcx.query_system.query_vtables.$name, | 492 | &self.tcx.query_system.query_vtables.$name, |
| 512 | $crate::query::IntoQueryParam::into_query_param(key), | 493 | $crate::query::IntoQueryParam::into_query_param(key), |
| ... | @@ -560,24 +541,22 @@ macro_rules! define_callbacks { | ... | @@ -560,24 +541,22 @@ macro_rules! define_callbacks { |
| 560 | } | 541 | } |
| 561 | 542 | ||
| 562 | $( | 543 | $( |
| 563 | item_if_feedable! { | 544 | #[cfg($feedable)] |
| 564 | [$($modifiers)*] | 545 | impl<'tcx, K: $crate::query::IntoQueryParam<$name::Key<'tcx>> + Copy> |
| 565 | impl<'tcx, K: $crate::query::IntoQueryParam<$name::Key<'tcx>> + Copy> | 546 | TyCtxtFeed<'tcx, K> |
| 566 | TyCtxtFeed<'tcx, K> | 547 | { |
| 567 | { | 548 | $(#[$attr])* |
| 568 | $(#[$attr])* | 549 | #[inline(always)] |
| 569 | #[inline(always)] | 550 | pub fn $name(self, value: $name::ProvidedValue<'tcx>) { |
| 570 | pub fn $name(self, value: $name::ProvidedValue<'tcx>) { | 551 | let key = self.key().into_query_param(); |
| 571 | let key = self.key().into_query_param(); | 552 | let erased_value = $name::provided_to_erased(self.tcx, value); |
| 572 | let erased_value = $name::provided_to_erased(self.tcx, value); | 553 | $crate::query::inner::query_feed( |
| 573 | $crate::query::inner::query_feed( | 554 | self.tcx, |
| 574 | self.tcx, | 555 | dep_graph::DepKind::$name, |
| 575 | dep_graph::DepKind::$name, | 556 | &self.tcx.query_system.query_vtables.$name, |
| 576 | &self.tcx.query_system.query_vtables.$name, | 557 | key, |
| 577 | key, | 558 | erased_value, |
| 578 | erased_value, | 559 | ); |
| 579 | ); | ||
| 580 | } | ||
| 581 | } | 560 | } |
| 582 | } | 561 | } |
| 583 | )* | 562 | )* |
| ... | @@ -602,11 +581,11 @@ macro_rules! define_callbacks { | ... | @@ -602,11 +581,11 @@ macro_rules! define_callbacks { |
| 602 | 581 | ||
| 603 | pub struct ExternProviders { | 582 | pub struct ExternProviders { |
| 604 | $( | 583 | $( |
| 605 | pub $name: if_separate_provide_extern!( | 584 | #[cfg($separate_provide_extern)] |
| 606 | [$($modifiers)*] | 585 | pub $name: for<'tcx> fn( |
| 607 | (for<'tcx> fn(TyCtxt<'tcx>, $name::Key<'tcx>) -> $name::ProvidedValue<'tcx>) | 586 | TyCtxt<'tcx>, |
| 608 | () | 587 | $name::Key<'tcx>, |
| 609 | ), | 588 | ) -> $name::ProvidedValue<'tcx>, |
| 610 | )* | 589 | )* |
| 611 | } | 590 | } |
| 612 | 591 | ||
| ... | @@ -626,13 +605,10 @@ macro_rules! define_callbacks { | ... | @@ -626,13 +605,10 @@ macro_rules! define_callbacks { |
| 626 | fn default() -> Self { | 605 | fn default() -> Self { |
| 627 | ExternProviders { | 606 | ExternProviders { |
| 628 | $( | 607 | $( |
| 629 | $name: if_separate_provide_extern!( | 608 | #[cfg($separate_provide_extern)] |
| 630 | [$($modifiers)*] | 609 | $name: |_, key| $crate::query::plumbing::default_extern_query( |
| 631 | (|_, key| $crate::query::plumbing::default_extern_query( | 610 | stringify!($name), |
| 632 | stringify!($name), | 611 | &key, |
| 633 | &key | ||
| 634 | )) | ||
| 635 | () | ||
| 636 | ), | 612 | ), |
| 637 | )* | 613 | )* |
| 638 | } | 614 | } |
compiler/rustc_middle/src/traits/specialization_graph.rs+2-2| ... | @@ -175,7 +175,7 @@ pub struct LeafDef { | ... | @@ -175,7 +175,7 @@ pub struct LeafDef { |
| 175 | /// The node in the specialization graph containing the definition of `item`. | 175 | /// The node in the specialization graph containing the definition of `item`. |
| 176 | pub defining_node: Node, | 176 | pub defining_node: Node, |
| 177 | 177 | ||
| 178 | /// The "top-most" (ie. least specialized) specialization graph node that finalized the | 178 | /// The "top-most" (i.e. least specialized) specialization graph node that finalized the |
| 179 | /// definition of `item`. | 179 | /// definition of `item`. |
| 180 | /// | 180 | /// |
| 181 | /// Example: | 181 | /// Example: |
| ... | @@ -210,7 +210,7 @@ impl LeafDef { | ... | @@ -210,7 +210,7 @@ impl LeafDef { |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | impl<'tcx> Ancestors<'tcx> { | 212 | impl<'tcx> Ancestors<'tcx> { |
| 213 | /// Finds the bottom-most (ie. most specialized) definition of an associated | 213 | /// Finds the bottom-most (i.e. most specialized) definition of an associated |
| 214 | /// item. | 214 | /// item. |
| 215 | pub fn leaf_def(mut self, tcx: TyCtxt<'tcx>, trait_item_def_id: DefId) -> Option<LeafDef> { | 215 | pub fn leaf_def(mut self, tcx: TyCtxt<'tcx>, trait_item_def_id: DefId) -> Option<LeafDef> { |
| 216 | let mut finalizing_node = None; | 216 | let mut finalizing_node = None; |
compiler/rustc_mir_transform/src/elaborate_drop.rs+1-1| ... | @@ -160,7 +160,7 @@ where | ... | @@ -160,7 +160,7 @@ where |
| 160 | /// | 160 | /// |
| 161 | /// The passed `elaborator` is used to determine what should happen at the drop terminator. It | 161 | /// The passed `elaborator` is used to determine what should happen at the drop terminator. It |
| 162 | /// decides whether the drop can be statically determined or whether it needs a dynamic drop flag, | 162 | /// decides whether the drop can be statically determined or whether it needs a dynamic drop flag, |
| 163 | /// and whether the drop is "open", ie. should be expanded to drop all subfields of the dropped | 163 | /// and whether the drop is "open", i.e. should be expanded to drop all subfields of the dropped |
| 164 | /// value. | 164 | /// value. |
| 165 | /// | 165 | /// |
| 166 | /// When this returns, the MIR patch in the `elaborator` contains the necessary changes. | 166 | /// When this returns, the MIR patch in the `elaborator` contains the necessary changes. |
compiler/rustc_mir_transform/src/ref_prop.rs+1-1| ... | @@ -245,7 +245,7 @@ fn compute_replacement<'tcx>( | ... | @@ -245,7 +245,7 @@ fn compute_replacement<'tcx>( |
| 245 | debug!(?rvalue); | 245 | debug!(?rvalue); |
| 246 | match rvalue { | 246 | match rvalue { |
| 247 | // This is a copy, just use the value we have in store for the previous one. | 247 | // This is a copy, just use the value we have in store for the previous one. |
| 248 | // As we are visiting in `assignment_order`, ie. reverse postorder, `rhs` should | 248 | // As we are visiting in `assignment_order`, i.e. reverse postorder, `rhs` should |
| 249 | // have been visited before. | 249 | // have been visited before. |
| 250 | Rvalue::Use(Operand::Copy(place) | Operand::Move(place)) => { | 250 | Rvalue::Use(Operand::Copy(place) | Operand::Move(place)) => { |
| 251 | if let Some(rhs) = place.as_local() | 251 | if let Some(rhs) = place.as_local() |
compiler/rustc_mir_transform/src/ssa.rs+2-2| ... | @@ -25,7 +25,7 @@ pub(super) struct SsaLocals { | ... | @@ -25,7 +25,7 @@ pub(super) struct SsaLocals { |
| 25 | assignment_order: Vec<Local>, | 25 | assignment_order: Vec<Local>, |
| 26 | /// Copy equivalence classes between locals. See `copy_classes` for documentation. | 26 | /// Copy equivalence classes between locals. See `copy_classes` for documentation. |
| 27 | copy_classes: IndexVec<Local, Local>, | 27 | copy_classes: IndexVec<Local, Local>, |
| 28 | /// Number of "direct" uses of each local, ie. uses that are not dereferences. | 28 | /// Number of "direct" uses of each local, i.e. uses that are not dereferences. |
| 29 | /// We ignore non-uses (Storage statements, debuginfo). | 29 | /// We ignore non-uses (Storage statements, debuginfo). |
| 30 | direct_uses: IndexVec<Local, u32>, | 30 | direct_uses: IndexVec<Local, u32>, |
| 31 | /// Set of SSA locals that are immutably borrowed. | 31 | /// Set of SSA locals that are immutably borrowed. |
| ... | @@ -314,7 +314,7 @@ fn compute_copy_classes(ssa: &mut SsaLocals, body: &Body<'_>) { | ... | @@ -314,7 +314,7 @@ fn compute_copy_classes(ssa: &mut SsaLocals, body: &Body<'_>) { |
| 314 | continue; | 314 | continue; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | // We visit in `assignment_order`, ie. reverse post-order, so `rhs` has been | 317 | // We visit in `assignment_order`, i.e. reverse post-order, so `rhs` has been |
| 318 | // visited before `local`, and we just have to copy the representing local. | 318 | // visited before `local`, and we just have to copy the representing local. |
| 319 | let head = copies[rhs]; | 319 | let head = copies[rhs]; |
| 320 | 320 |
compiler/rustc_parse/src/errors.rs+28| ... | @@ -1269,6 +1269,26 @@ pub(crate) struct IncorrectVisibilityRestriction { | ... | @@ -1269,6 +1269,26 @@ pub(crate) struct IncorrectVisibilityRestriction { |
| 1269 | pub inner_str: String, | 1269 | pub inner_str: String, |
| 1270 | } | 1270 | } |
| 1271 | 1271 | ||
| 1272 | #[derive(Diagnostic)] | ||
| 1273 | #[diag("incorrect `impl` restriction")] | ||
| 1274 | #[help( | ||
| 1275 | "some possible `impl` restrictions are: | ||
| 1276 | `impl(crate)`: can only be implemented in the current crate | ||
| 1277 | `impl(super)`: can only be implemented in the parent module | ||
| 1278 | `impl(self)`: can only be implemented in current module | ||
| 1279 | `impl(in path::to::module)`: can only be implemented in the specified path" | ||
| 1280 | )] | ||
| 1281 | pub(crate) struct IncorrectImplRestriction { | ||
| 1282 | #[primary_span] | ||
| 1283 | #[suggestion( | ||
| 1284 | "help: use `in` to restrict implementations to the path `{$inner_str}`", | ||
| 1285 | code = "in {inner_str}", | ||
| 1286 | applicability = "machine-applicable" | ||
| 1287 | )] | ||
| 1288 | pub span: Span, | ||
| 1289 | pub inner_str: String, | ||
| 1290 | } | ||
| 1291 | |||
| 1272 | #[derive(Diagnostic)] | 1292 | #[derive(Diagnostic)] |
| 1273 | #[diag("<assignment> ... else {\"{\"} ... {\"}\"} is not allowed")] | 1293 | #[diag("<assignment> ... else {\"{\"} ... {\"}\"} is not allowed")] |
| 1274 | pub(crate) struct AssignmentElseNotAllowed { | 1294 | pub(crate) struct AssignmentElseNotAllowed { |
| ... | @@ -2403,6 +2423,14 @@ pub(crate) struct TraitAliasCannotBeUnsafe { | ... | @@ -2403,6 +2423,14 @@ pub(crate) struct TraitAliasCannotBeUnsafe { |
| 2403 | pub span: Span, | 2423 | pub span: Span, |
| 2404 | } | 2424 | } |
| 2405 | 2425 | ||
| 2426 | #[derive(Diagnostic)] | ||
| 2427 | #[diag("trait aliases cannot be `impl`-restricted")] | ||
| 2428 | pub(crate) struct TraitAliasCannotBeImplRestricted { | ||
| 2429 | #[primary_span] | ||
| 2430 | #[label("trait aliases cannot be `impl`-restricted")] | ||
| 2431 | pub span: Span, | ||
| 2432 | } | ||
| 2433 | |||
| 2406 | #[derive(Diagnostic)] | 2434 | #[derive(Diagnostic)] |
| 2407 | #[diag("associated `static` items are not allowed")] | 2435 | #[diag("associated `static` items are not allowed")] |
| 2408 | pub(crate) struct AssociatedStaticItemNotAllowed { | 2436 | pub(crate) struct AssociatedStaticItemNotAllowed { |
compiler/rustc_parse/src/parser/item.rs+78-10| ... | @@ -1025,17 +1025,79 @@ impl<'a> Parser<'a> { | ... | @@ -1025,17 +1025,79 @@ impl<'a> Parser<'a> { |
| 1025 | } | 1025 | } |
| 1026 | } | 1026 | } |
| 1027 | 1027 | ||
| 1028 | /// Is this an `(const unsafe? auto?| unsafe auto? | auto) trait` item? | 1028 | /// Is there an `[ impl(in? path) ]? trait` item `dist` tokens ahead? |
| 1029 | fn is_trait_with_maybe_impl_restriction_in_front(&self, dist: usize) -> bool { | ||
| 1030 | // `trait` | ||
| 1031 | if self.is_keyword_ahead(dist, &[kw::Trait]) { | ||
| 1032 | return true; | ||
| 1033 | } | ||
| 1034 | // `impl(` | ||
| 1035 | if !self.is_keyword_ahead(dist, &[kw::Impl]) | ||
| 1036 | || !self.look_ahead(dist + 1, |t| t == &token::OpenParen) | ||
| 1037 | { | ||
| 1038 | return false; | ||
| 1039 | } | ||
| 1040 | // `crate | super | self) trait` | ||
| 1041 | if self.is_keyword_ahead(dist + 2, &[kw::Crate, kw::Super, kw::SelfLower]) | ||
| 1042 | && self.look_ahead(dist + 3, |t| t == &token::CloseParen) | ||
| 1043 | && self.is_keyword_ahead(dist + 4, &[kw::Trait]) | ||
| 1044 | { | ||
| 1045 | return true; | ||
| 1046 | } | ||
| 1047 | // `impl(in? something) trait` | ||
| 1048 | // We catch cases where the `in` keyword is missing to provide a | ||
| 1049 | // better error message. This is handled later in | ||
| 1050 | // `self.recover_incorrect_impl_restriction`. | ||
| 1051 | self.tree_look_ahead(dist + 2, |t| { | ||
| 1052 | if let TokenTree::Token(token, _) = t { token.is_keyword(kw::Trait) } else { false } | ||
| 1053 | }) | ||
| 1054 | .unwrap_or(false) | ||
| 1055 | } | ||
| 1056 | |||
| 1057 | /// Is this an `(const unsafe? auto? [ impl(in? path) ]? | unsafe auto? [ impl(in? path) ]? | auto [ impl(in? path) ]? | [ impl(in? path) ]?) trait` item? | ||
| 1029 | fn check_trait_front_matter(&mut self) -> bool { | 1058 | fn check_trait_front_matter(&mut self) -> bool { |
| 1030 | // auto trait | 1059 | // `[ impl(in? path) ]? trait` |
| 1031 | self.check_keyword(exp!(Auto)) && self.is_keyword_ahead(1, &[kw::Trait]) | 1060 | if self.is_trait_with_maybe_impl_restriction_in_front(0) { |
| 1032 | // unsafe auto trait | 1061 | return true; |
| 1033 | || self.check_keyword(exp!(Unsafe)) && self.is_keyword_ahead(1, &[kw::Trait, kw::Auto]) | 1062 | } |
| 1034 | || self.check_keyword(exp!(Const)) && ((self.is_keyword_ahead(1, &[kw::Trait]) || self.is_keyword_ahead(1, &[kw::Auto]) && self.is_keyword_ahead(2, &[kw::Trait])) | 1063 | // `auto [ impl(in? path) ]? trait` |
| 1035 | || self.is_keyword_ahead(1, &[kw::Unsafe]) && self.is_keyword_ahead(2, &[kw::Trait, kw::Auto])) | 1064 | if self.check_keyword(exp!(Auto)) && self.is_trait_with_maybe_impl_restriction_in_front(1) { |
| 1065 | return true; | ||
| 1066 | } | ||
| 1067 | // `unsafe auto? [ impl(in? path) ]? trait` | ||
| 1068 | if self.check_keyword(exp!(Unsafe)) | ||
| 1069 | && (self.is_trait_with_maybe_impl_restriction_in_front(1) | ||
| 1070 | || self.is_keyword_ahead(1, &[kw::Auto]) | ||
| 1071 | && self.is_trait_with_maybe_impl_restriction_in_front(2)) | ||
| 1072 | { | ||
| 1073 | return true; | ||
| 1074 | } | ||
| 1075 | // `const` ... | ||
| 1076 | if !self.check_keyword(exp!(Const)) { | ||
| 1077 | return false; | ||
| 1078 | } | ||
| 1079 | // `const [ impl(in? path) ]? trait` | ||
| 1080 | if self.is_trait_with_maybe_impl_restriction_in_front(1) { | ||
| 1081 | return true; | ||
| 1082 | } | ||
| 1083 | // `const (unsafe | auto) [ impl(in? path) ]? trait` | ||
| 1084 | if self.is_keyword_ahead(1, &[kw::Unsafe, kw::Auto]) | ||
| 1085 | && self.is_trait_with_maybe_impl_restriction_in_front(2) | ||
| 1086 | { | ||
| 1087 | return true; | ||
| 1088 | } | ||
| 1089 | // `const unsafe auto [ impl(in? path) ]? trait` | ||
| 1090 | self.is_keyword_ahead(1, &[kw::Unsafe]) | ||
| 1091 | && self.is_keyword_ahead(2, &[kw::Auto]) | ||
| 1092 | && self.is_trait_with_maybe_impl_restriction_in_front(3) | ||
| 1036 | } | 1093 | } |
| 1037 | 1094 | ||
| 1038 | /// Parses `unsafe? auto? trait Foo { ... }` or `trait Foo = Bar;`. | 1095 | /// Parses `const? unsafe? auto? [impl(in? path)]? trait Foo { ... }` or `trait Foo = Bar;`. |
| 1096 | /// | ||
| 1097 | /// FIXME(restrictions): The current keyword order follows the grammar specified in RFC 3323. | ||
| 1098 | /// However, whether the restriction should be grouped closer to the visibility modifier | ||
| 1099 | /// (e.g., `pub impl(crate) const unsafe auto trait`) remains an unresolved design question. | ||
| 1100 | /// This ordering must be kept in sync with the logic in `check_trait_front_matter`. | ||
| 1039 | fn parse_item_trait(&mut self, attrs: &mut AttrVec, lo: Span) -> PResult<'a, ItemKind> { | 1101 | fn parse_item_trait(&mut self, attrs: &mut AttrVec, lo: Span) -> PResult<'a, ItemKind> { |
| 1040 | let constness = self.parse_constness(Case::Sensitive); | 1102 | let constness = self.parse_constness(Case::Sensitive); |
| 1041 | if let Const::Yes(span) = constness { | 1103 | if let Const::Yes(span) = constness { |
| ... | @@ -1050,6 +1112,8 @@ impl<'a> Parser<'a> { | ... | @@ -1050,6 +1112,8 @@ impl<'a> Parser<'a> { |
| 1050 | IsAuto::No | 1112 | IsAuto::No |
| 1051 | }; | 1113 | }; |
| 1052 | 1114 | ||
| 1115 | let impl_restriction = self.parse_impl_restriction()?; | ||
| 1116 | |||
| 1053 | self.expect_keyword(exp!(Trait))?; | 1117 | self.expect_keyword(exp!(Trait))?; |
| 1054 | let ident = self.parse_ident()?; | 1118 | let ident = self.parse_ident()?; |
| 1055 | let mut generics = self.parse_generics()?; | 1119 | let mut generics = self.parse_generics()?; |
| ... | @@ -1078,6 +1142,9 @@ impl<'a> Parser<'a> { | ... | @@ -1078,6 +1142,9 @@ impl<'a> Parser<'a> { |
| 1078 | if let Safety::Unsafe(_) = safety { | 1142 | if let Safety::Unsafe(_) = safety { |
| 1079 | self.dcx().emit_err(errors::TraitAliasCannotBeUnsafe { span: whole_span }); | 1143 | self.dcx().emit_err(errors::TraitAliasCannotBeUnsafe { span: whole_span }); |
| 1080 | } | 1144 | } |
| 1145 | if let RestrictionKind::Restricted { .. } = impl_restriction.kind { | ||
| 1146 | self.dcx().emit_err(errors::TraitAliasCannotBeImplRestricted { span: whole_span }); | ||
| 1147 | } | ||
| 1081 | 1148 | ||
| 1082 | self.psess.gated_spans.gate(sym::trait_alias, whole_span); | 1149 | self.psess.gated_spans.gate(sym::trait_alias, whole_span); |
| 1083 | 1150 | ||
| ... | @@ -1090,6 +1157,7 @@ impl<'a> Parser<'a> { | ... | @@ -1090,6 +1157,7 @@ impl<'a> Parser<'a> { |
| 1090 | constness, | 1157 | constness, |
| 1091 | is_auto, | 1158 | is_auto, |
| 1092 | safety, | 1159 | safety, |
| 1160 | impl_restriction, | ||
| 1093 | ident, | 1161 | ident, |
| 1094 | generics, | 1162 | generics, |
| 1095 | bounds, | 1163 | bounds, |
| ... | @@ -2858,8 +2926,8 @@ impl<'a> Parser<'a> { | ... | @@ -2858,8 +2926,8 @@ impl<'a> Parser<'a> { |
| 2858 | && !self.is_unsafe_foreign_mod() | 2926 | && !self.is_unsafe_foreign_mod() |
| 2859 | // Rule out `async gen {` and `async gen move {` | 2927 | // Rule out `async gen {` and `async gen move {` |
| 2860 | && !self.is_async_gen_block() | 2928 | && !self.is_async_gen_block() |
| 2861 | // Rule out `const unsafe auto` and `const unsafe trait`. | 2929 | // Rule out `const unsafe auto` and `const unsafe trait` and `const unsafe impl`. |
| 2862 | && !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait]) | 2930 | && !self.is_keyword_ahead(2, &[kw::Auto, kw::Trait, kw::Impl]) |
| 2863 | ) | 2931 | ) |
| 2864 | }) | 2932 | }) |
| 2865 | // `extern ABI fn` | 2933 | // `extern ABI fn` |
compiler/rustc_parse/src/parser/mod.rs+61-3| ... | @@ -35,8 +35,9 @@ use rustc_ast::util::case::Case; | ... | @@ -35,8 +35,9 @@ use rustc_ast::util::case::Case; |
| 35 | use rustc_ast::util::classify; | 35 | use rustc_ast::util::classify; |
| 36 | use rustc_ast::{ | 36 | use rustc_ast::{ |
| 37 | self as ast, AnonConst, AttrArgs, AttrId, BinOpKind, ByRef, Const, CoroutineKind, | 37 | self as ast, AnonConst, AttrArgs, AttrId, BinOpKind, ByRef, Const, CoroutineKind, |
| 38 | DUMMY_NODE_ID, DelimArgs, Expr, ExprKind, Extern, HasAttrs, HasTokens, MgcaDisambiguation, | 38 | DUMMY_NODE_ID, DelimArgs, Expr, ExprKind, Extern, HasAttrs, HasTokens, ImplRestriction, |
| 39 | Mutability, Recovered, Safety, StrLit, Visibility, VisibilityKind, | 39 | MgcaDisambiguation, Mutability, Recovered, RestrictionKind, Safety, StrLit, Visibility, |
| 40 | VisibilityKind, | ||
| 40 | }; | 41 | }; |
| 41 | use rustc_ast_pretty::pprust; | 42 | use rustc_ast_pretty::pprust; |
| 42 | use rustc_data_structures::debug_assert_matches; | 43 | use rustc_data_structures::debug_assert_matches; |
| ... | @@ -50,7 +51,10 @@ use token_type::TokenTypeSet; | ... | @@ -50,7 +51,10 @@ use token_type::TokenTypeSet; |
| 50 | pub use token_type::{ExpKeywordPair, ExpTokenPair, TokenType}; | 51 | pub use token_type::{ExpKeywordPair, ExpTokenPair, TokenType}; |
| 51 | use tracing::debug; | 52 | use tracing::debug; |
| 52 | 53 | ||
| 53 | use crate::errors::{self, IncorrectVisibilityRestriction, NonStringAbiLiteral, TokenDescription}; | 54 | use crate::errors::{ |
| 55 | self, IncorrectImplRestriction, IncorrectVisibilityRestriction, NonStringAbiLiteral, | ||
| 56 | TokenDescription, | ||
| 57 | }; | ||
| 54 | use crate::exp; | 58 | use crate::exp; |
| 55 | 59 | ||
| 56 | #[cfg(test)] | 60 | #[cfg(test)] |
| ... | @@ -1530,6 +1534,60 @@ impl<'a> Parser<'a> { | ... | @@ -1530,6 +1534,60 @@ impl<'a> Parser<'a> { |
| 1530 | Ok(()) | 1534 | Ok(()) |
| 1531 | } | 1535 | } |
| 1532 | 1536 | ||
| 1537 | /// Parses an optional `impl` restriction. | ||
| 1538 | /// Enforces the `impl_restriction` feature gate whenever an explicit restriction is encountered. | ||
| 1539 | fn parse_impl_restriction(&mut self) -> PResult<'a, ImplRestriction> { | ||
| 1540 | if self.eat_keyword(exp!(Impl)) { | ||
| 1541 | let lo = self.prev_token.span; | ||
| 1542 | // No units or tuples are allowed to follow `impl` here, so we can safely bump `(`. | ||
| 1543 | self.expect(exp!(OpenParen))?; | ||
| 1544 | if self.eat_keyword(exp!(In)) { | ||
| 1545 | let path = self.parse_path(PathStyle::Mod)?; // `in path` | ||
| 1546 | self.expect(exp!(CloseParen))?; // `)` | ||
| 1547 | let restriction = RestrictionKind::Restricted { | ||
| 1548 | path: Box::new(path), | ||
| 1549 | id: ast::DUMMY_NODE_ID, | ||
| 1550 | shorthand: false, | ||
| 1551 | }; | ||
| 1552 | let span = lo.to(self.prev_token.span); | ||
| 1553 | self.psess.gated_spans.gate(sym::impl_restriction, span); | ||
| 1554 | return Ok(ImplRestriction { kind: restriction, span, tokens: None }); | ||
| 1555 | } else if self.look_ahead(1, |t| t == &token::CloseParen) | ||
| 1556 | && self.is_keyword_ahead(0, &[kw::Crate, kw::Super, kw::SelfLower]) | ||
| 1557 | { | ||
| 1558 | let path = self.parse_path(PathStyle::Mod)?; // `crate`/`super`/`self` | ||
| 1559 | self.expect(exp!(CloseParen))?; // `)` | ||
| 1560 | let restriction = RestrictionKind::Restricted { | ||
| 1561 | path: Box::new(path), | ||
| 1562 | id: ast::DUMMY_NODE_ID, | ||
| 1563 | shorthand: true, | ||
| 1564 | }; | ||
| 1565 | let span = lo.to(self.prev_token.span); | ||
| 1566 | self.psess.gated_spans.gate(sym::impl_restriction, span); | ||
| 1567 | return Ok(ImplRestriction { kind: restriction, span, tokens: None }); | ||
| 1568 | } else { | ||
| 1569 | self.recover_incorrect_impl_restriction(lo)?; | ||
| 1570 | // Emit diagnostic, but continue with no impl restriction. | ||
| 1571 | } | ||
| 1572 | } | ||
| 1573 | Ok(ImplRestriction { | ||
| 1574 | kind: RestrictionKind::Unrestricted, | ||
| 1575 | span: self.token.span.shrink_to_lo(), | ||
| 1576 | tokens: None, | ||
| 1577 | }) | ||
| 1578 | } | ||
| 1579 | |||
| 1580 | /// Recovery for e.g. `impl(something) trait` | ||
| 1581 | fn recover_incorrect_impl_restriction(&mut self, lo: Span) -> PResult<'a, ()> { | ||
| 1582 | let path = self.parse_path(PathStyle::Mod)?; | ||
| 1583 | self.expect(exp!(CloseParen))?; // `)` | ||
| 1584 | let path_str = pprust::path_to_string(&path); | ||
| 1585 | self.dcx().emit_err(IncorrectImplRestriction { span: path.span, inner_str: path_str }); | ||
| 1586 | let end = self.prev_token.span; | ||
| 1587 | self.psess.gated_spans.gate(sym::impl_restriction, lo.to(end)); | ||
| 1588 | Ok(()) | ||
| 1589 | } | ||
| 1590 | |||
| 1533 | /// Parses `extern string_literal?`. | 1591 | /// Parses `extern string_literal?`. |
| 1534 | fn parse_extern(&mut self, case: Case) -> Extern { | 1592 | fn parse_extern(&mut self, case: Case) -> Extern { |
| 1535 | if self.eat_keyword_case(exp!(Extern), case) { | 1593 | if self.eat_keyword_case(exp!(Extern), case) { |
compiler/rustc_query_impl/src/dep_kind_vtables.rs+17-5| ... | @@ -130,8 +130,20 @@ macro_rules! define_dep_kind_vtables { | ... | @@ -130,8 +130,20 @@ macro_rules! define_dep_kind_vtables { |
| 130 | queries { | 130 | queries { |
| 131 | $( | 131 | $( |
| 132 | $(#[$attr:meta])* | 132 | $(#[$attr:meta])* |
| 133 | [$($modifiers:tt)*] | 133 | fn $name:ident($K:ty) -> $V:ty |
| 134 | fn $name:ident($K:ty) -> $V:ty, | 134 | { |
| 135 | // Search for (QMODLIST) to find all occurrences of this query modifier list. | ||
| 136 | anon: $anon:literal, | ||
| 137 | arena_cache: $arena_cache:literal, | ||
| 138 | cache_on_disk: $cache_on_disk:literal, | ||
| 139 | cycle_error_handling: $cycle_error_handling:ident, | ||
| 140 | depth_limit: $depth_limit:literal, | ||
| 141 | eval_always: $eval_always:literal, | ||
| 142 | feedable: $feedable:literal, | ||
| 143 | no_hash: $no_hash:literal, | ||
| 144 | return_result_from_ensure_ok: $return_result_from_ensure_ok:literal, | ||
| 145 | separate_provide_extern: $separate_provide_extern:literal, | ||
| 146 | } | ||
| 135 | )* | 147 | )* |
| 136 | } | 148 | } |
| 137 | non_queries { | 149 | non_queries { |
| ... | @@ -154,9 +166,9 @@ macro_rules! define_dep_kind_vtables { | ... | @@ -154,9 +166,9 @@ macro_rules! define_dep_kind_vtables { |
| 154 | $crate::dep_kind_vtables::make_dep_kind_vtable_for_query::< | 166 | $crate::dep_kind_vtables::make_dep_kind_vtable_for_query::< |
| 155 | $crate::query_impl::$name::VTableGetter, | 167 | $crate::query_impl::$name::VTableGetter, |
| 156 | >( | 168 | >( |
| 157 | is_anon!([$($modifiers)*]), | 169 | $anon, |
| 158 | if_cache_on_disk!([$($modifiers)*] true false), | 170 | $cache_on_disk, |
| 159 | is_eval_always!([$($modifiers)*]), | 171 | $eval_always, |
| 160 | ) | 172 | ) |
| 161 | ),* | 173 | ),* |
| 162 | ]; | 174 | ]; |
compiler/rustc_query_impl/src/plumbing.rs+71-166| ... | @@ -99,125 +99,6 @@ pub(super) fn try_mark_green<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> boo | ... | @@ -99,125 +99,6 @@ pub(super) fn try_mark_green<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> boo |
| 99 | tcx.dep_graph.try_mark_green(tcx, dep_node).is_some() | 99 | tcx.dep_graph.try_mark_green(tcx, dep_node).is_some() |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | macro_rules! cycle_error_handling { | ||
| 103 | ([]) => {{ | ||
| 104 | rustc_middle::query::CycleErrorHandling::Error | ||
| 105 | }}; | ||
| 106 | ([(cycle_fatal) $($rest:tt)*]) => {{ | ||
| 107 | rustc_middle::query::CycleErrorHandling::Fatal | ||
| 108 | }}; | ||
| 109 | ([(cycle_stash) $($rest:tt)*]) => {{ | ||
| 110 | rustc_middle::query::CycleErrorHandling::Stash | ||
| 111 | }}; | ||
| 112 | ([(cycle_delay_bug) $($rest:tt)*]) => {{ | ||
| 113 | rustc_middle::query::CycleErrorHandling::DelayBug | ||
| 114 | }}; | ||
| 115 | ([$other:tt $($modifiers:tt)*]) => { | ||
| 116 | cycle_error_handling!([$($modifiers)*]) | ||
| 117 | }; | ||
| 118 | } | ||
| 119 | |||
| 120 | macro_rules! is_anon { | ||
| 121 | ([]) => {{ | ||
| 122 | false | ||
| 123 | }}; | ||
| 124 | ([(anon) $($rest:tt)*]) => {{ | ||
| 125 | true | ||
| 126 | }}; | ||
| 127 | ([$other:tt $($modifiers:tt)*]) => { | ||
| 128 | is_anon!([$($modifiers)*]) | ||
| 129 | }; | ||
| 130 | } | ||
| 131 | |||
| 132 | macro_rules! is_eval_always { | ||
| 133 | ([]) => {{ | ||
| 134 | false | ||
| 135 | }}; | ||
| 136 | ([(eval_always) $($rest:tt)*]) => {{ | ||
| 137 | true | ||
| 138 | }}; | ||
| 139 | ([$other:tt $($modifiers:tt)*]) => { | ||
| 140 | is_eval_always!([$($modifiers)*]) | ||
| 141 | }; | ||
| 142 | } | ||
| 143 | |||
| 144 | macro_rules! is_depth_limit { | ||
| 145 | ([]) => {{ | ||
| 146 | false | ||
| 147 | }}; | ||
| 148 | ([(depth_limit) $($rest:tt)*]) => {{ | ||
| 149 | true | ||
| 150 | }}; | ||
| 151 | ([$other:tt $($modifiers:tt)*]) => { | ||
| 152 | is_depth_limit!([$($modifiers)*]) | ||
| 153 | }; | ||
| 154 | } | ||
| 155 | |||
| 156 | macro_rules! is_feedable { | ||
| 157 | ([]) => {{ | ||
| 158 | false | ||
| 159 | }}; | ||
| 160 | ([(feedable) $($rest:tt)*]) => {{ | ||
| 161 | true | ||
| 162 | }}; | ||
| 163 | ([$other:tt $($modifiers:tt)*]) => { | ||
| 164 | is_feedable!([$($modifiers)*]) | ||
| 165 | }; | ||
| 166 | } | ||
| 167 | |||
| 168 | /// Expands to `$yes` if the `no_hash` modifier is present, or `$no` otherwise. | ||
| 169 | macro_rules! if_no_hash { | ||
| 170 | ([] $yes:tt $no:tt) => { $no }; | ||
| 171 | ([(no_hash) $($modifiers:tt)*] $yes:tt $no:tt) => { $yes }; | ||
| 172 | ([$other:tt $($modifiers:tt)*] $yes:tt $no:tt) => { | ||
| 173 | if_no_hash!([$($modifiers)*] $yes $no) | ||
| 174 | } | ||
| 175 | } | ||
| 176 | |||
| 177 | macro_rules! call_provider { | ||
| 178 | ([][$tcx:expr, $name:ident, $key:expr]) => {{ | ||
| 179 | ($tcx.query_system.local_providers.$name)($tcx, $key) | ||
| 180 | }}; | ||
| 181 | ([(separate_provide_extern) $($rest:tt)*][$tcx:expr, $name:ident, $key:expr]) => {{ | ||
| 182 | if let Some(key) = $key.as_local_key() { | ||
| 183 | ($tcx.query_system.local_providers.$name)($tcx, key) | ||
| 184 | } else { | ||
| 185 | ($tcx.query_system.extern_providers.$name)($tcx, $key) | ||
| 186 | } | ||
| 187 | }}; | ||
| 188 | ([$other:tt $($modifiers:tt)*][$($args:tt)*]) => { | ||
| 189 | call_provider!([$($modifiers)*][$($args)*]) | ||
| 190 | }; | ||
| 191 | } | ||
| 192 | |||
| 193 | /// Expands to one of two token trees, depending on whether the current query | ||
| 194 | /// has the `cache_on_disk_if` modifier. | ||
| 195 | macro_rules! if_cache_on_disk { | ||
| 196 | ([] $yes:tt $no:tt) => { | ||
| 197 | $no | ||
| 198 | }; | ||
| 199 | // The `cache_on_disk_if` modifier generates a synthetic `(cache_on_disk)`, | ||
| 200 | // modifier, for use by this macro and similar macros. | ||
| 201 | ([(cache_on_disk) $($rest:tt)*] $yes:tt $no:tt) => { | ||
| 202 | $yes | ||
| 203 | }; | ||
| 204 | ([$other:tt $($modifiers:tt)*] $yes:tt $no:tt) => { | ||
| 205 | if_cache_on_disk!([$($modifiers)*] $yes $no) | ||
| 206 | }; | ||
| 207 | } | ||
| 208 | |||
| 209 | /// Conditionally expands to some token trees, if the current query has the | ||
| 210 | /// `cache_on_disk_if` modifier. | ||
| 211 | macro_rules! item_if_cache_on_disk { | ||
| 212 | ([] $($item:tt)*) => {}; | ||
| 213 | ([(cache_on_disk) $($rest:tt)*] $($item:tt)*) => { | ||
| 214 | $($item)* | ||
| 215 | }; | ||
| 216 | ([$other:tt $($modifiers:tt)*] $($item:tt)*) => { | ||
| 217 | item_if_cache_on_disk! { [$($modifiers)*] $($item)* } | ||
| 218 | }; | ||
| 219 | } | ||
| 220 | |||
| 221 | /// The deferred part of a deferred query stack frame. | 102 | /// The deferred part of a deferred query stack frame. |
| 222 | fn mk_query_stack_frame_extra<'tcx, Cache>( | 103 | fn mk_query_stack_frame_extra<'tcx, Cache>( |
| 223 | (tcx, vtable, key): (TyCtxt<'tcx>, &'tcx QueryVTable<'tcx, Cache>, Cache::Key), | 104 | (tcx, vtable, key): (TyCtxt<'tcx>, &'tcx QueryVTable<'tcx, Cache>, Cache::Key), |
| ... | @@ -421,8 +302,20 @@ macro_rules! define_queries { | ... | @@ -421,8 +302,20 @@ macro_rules! define_queries { |
| 421 | queries { | 302 | queries { |
| 422 | $( | 303 | $( |
| 423 | $(#[$attr:meta])* | 304 | $(#[$attr:meta])* |
| 424 | [$($modifiers:tt)*] | 305 | fn $name:ident($K:ty) -> $V:ty |
| 425 | fn $name:ident($K:ty) -> $V:ty, | 306 | { |
| 307 | // Search for (QMODLIST) to find all occurrences of this query modifier list. | ||
| 308 | anon: $anon:literal, | ||
| 309 | arena_cache: $arena_cache:literal, | ||
| 310 | cache_on_disk: $cache_on_disk:literal, | ||
| 311 | cycle_error_handling: $cycle_error_handling:ident, | ||
| 312 | depth_limit: $depth_limit:literal, | ||
| 313 | eval_always: $eval_always:literal, | ||
| 314 | feedable: $feedable:literal, | ||
| 315 | no_hash: $no_hash:literal, | ||
| 316 | return_result_from_ensure_ok: $return_result_from_ensure_ok:literal, | ||
| 317 | separate_provide_extern: $separate_provide_extern:literal, | ||
| 318 | } | ||
| 426 | )* | 319 | )* |
| 427 | } | 320 | } |
| 428 | // Non-queries are unused here. | 321 | // Non-queries are unused here. |
| ... | @@ -498,7 +391,16 @@ macro_rules! define_queries { | ... | @@ -498,7 +391,16 @@ macro_rules! define_queries { |
| 498 | let _guard = tracing::span!(tracing::Level::TRACE, stringify!($name), ?key).entered(); | 391 | let _guard = tracing::span!(tracing::Level::TRACE, stringify!($name), ?key).entered(); |
| 499 | 392 | ||
| 500 | // Call the actual provider function for this query. | 393 | // Call the actual provider function for this query. |
| 501 | let provided_value = call_provider!([$($modifiers)*][tcx, $name, key]); | 394 | |
| 395 | #[cfg($separate_provide_extern)] | ||
| 396 | let provided_value = if let Some(local_key) = key.as_local_key() { | ||
| 397 | (tcx.query_system.local_providers.$name)(tcx, local_key) | ||
| 398 | } else { | ||
| 399 | (tcx.query_system.extern_providers.$name)(tcx, key) | ||
| 400 | }; | ||
| 401 | |||
| 402 | #[cfg(not($separate_provide_extern))] | ||
| 403 | let provided_value = (tcx.query_system.local_providers.$name)(tcx, key); | ||
| 502 | 404 | ||
| 503 | rustc_middle::ty::print::with_reduced_queries!({ | 405 | rustc_middle::ty::print::with_reduced_queries!({ |
| 504 | tracing::trace!(?provided_value); | 406 | tracing::trace!(?provided_value); |
| ... | @@ -515,64 +417,67 @@ macro_rules! define_queries { | ... | @@ -515,64 +417,67 @@ macro_rules! define_queries { |
| 515 | { | 417 | { |
| 516 | QueryVTable { | 418 | QueryVTable { |
| 517 | name: stringify!($name), | 419 | name: stringify!($name), |
| 518 | anon: is_anon!([$($modifiers)*]), | 420 | anon: $anon, |
| 519 | eval_always: is_eval_always!([$($modifiers)*]), | 421 | eval_always: $eval_always, |
| 520 | depth_limit: is_depth_limit!([$($modifiers)*]), | 422 | depth_limit: $depth_limit, |
| 521 | feedable: is_feedable!([$($modifiers)*]), | 423 | feedable: $feedable, |
| 522 | dep_kind: dep_graph::DepKind::$name, | 424 | dep_kind: dep_graph::DepKind::$name, |
| 523 | cycle_error_handling: cycle_error_handling!([$($modifiers)*]), | 425 | cycle_error_handling: |
| 426 | rustc_middle::query::CycleErrorHandling::$cycle_error_handling, | ||
| 524 | state: Default::default(), | 427 | state: Default::default(), |
| 525 | cache: Default::default(), | 428 | cache: Default::default(), |
| 526 | will_cache_on_disk_for_key_fn: if_cache_on_disk!([$($modifiers)*] { | 429 | |
| 527 | Some(::rustc_middle::queries::_cache_on_disk_if_fns::$name) | 430 | #[cfg($cache_on_disk)] |
| 528 | } { | 431 | will_cache_on_disk_for_key_fn: |
| 529 | None | 432 | Some(rustc_middle::queries::_cache_on_disk_if_fns::$name), |
| 530 | }), | 433 | #[cfg(not($cache_on_disk))] |
| 434 | will_cache_on_disk_for_key_fn: None, | ||
| 435 | |||
| 531 | call_query_method_fn: |tcx, key| { | 436 | call_query_method_fn: |tcx, key| { |
| 532 | // Call the query method for its side-effect of loading a value | 437 | // Call the query method for its side-effect of loading a value |
| 533 | // from disk-cache; the caller doesn't need the value. | 438 | // from disk-cache; the caller doesn't need the value. |
| 534 | let _ = tcx.$name(key); | 439 | let _ = tcx.$name(key); |
| 535 | }, | 440 | }, |
| 536 | invoke_provider_fn: self::invoke_provider_fn::__rust_begin_short_backtrace, | 441 | invoke_provider_fn: self::invoke_provider_fn::__rust_begin_short_backtrace, |
| 537 | try_load_from_disk_fn: if_cache_on_disk!([$($modifiers)*] { | 442 | |
| 538 | Some(|tcx, key, prev_index, index| { | 443 | #[cfg($cache_on_disk)] |
| 539 | // Check the `cache_on_disk_if` condition for this key. | 444 | try_load_from_disk_fn: Some(|tcx, key, prev_index, index| { |
| 540 | if !::rustc_middle::queries::_cache_on_disk_if_fns::$name(tcx, key) { | 445 | // Check the `cache_on_disk_if` condition for this key. |
| 541 | return None; | 446 | if !rustc_middle::queries::_cache_on_disk_if_fns::$name(tcx, key) { |
| 542 | } | 447 | return None; |
| 543 | 448 | } | |
| 544 | let value: queries::$name::ProvidedValue<'tcx> = | 449 | |
| 545 | $crate::plumbing::try_load_from_disk(tcx, prev_index, index)?; | 450 | let value: queries::$name::ProvidedValue<'tcx> = |
| 546 | 451 | $crate::plumbing::try_load_from_disk(tcx, prev_index, index)?; | |
| 547 | // Arena-alloc the value if appropriate, and erase it. | 452 | |
| 548 | Some(queries::$name::provided_to_erased(tcx, value)) | 453 | // Arena-alloc the value if appropriate, and erase it. |
| 549 | }) | 454 | Some(queries::$name::provided_to_erased(tcx, value)) |
| 550 | } { | ||
| 551 | None | ||
| 552 | }), | 455 | }), |
| 553 | is_loadable_from_disk_fn: if_cache_on_disk!([$($modifiers)*] { | 456 | #[cfg(not($cache_on_disk))] |
| 554 | Some(|tcx, key, index| -> bool { | 457 | try_load_from_disk_fn: None, |
| 555 | ::rustc_middle::queries::_cache_on_disk_if_fns::$name(tcx, key) && | 458 | |
| 556 | $crate::plumbing::loadable_from_disk(tcx, index) | 459 | #[cfg($cache_on_disk)] |
| 557 | }) | 460 | is_loadable_from_disk_fn: Some(|tcx, key, index| -> bool { |
| 558 | } { | 461 | rustc_middle::queries::_cache_on_disk_if_fns::$name(tcx, key) && |
| 559 | None | 462 | $crate::plumbing::loadable_from_disk(tcx, index) |
| 560 | }), | 463 | }), |
| 464 | #[cfg(not($cache_on_disk))] | ||
| 465 | is_loadable_from_disk_fn: None, | ||
| 466 | |||
| 561 | value_from_cycle_error: |tcx, cycle, guar| { | 467 | value_from_cycle_error: |tcx, cycle, guar| { |
| 562 | let result: queries::$name::Value<'tcx> = | 468 | let result: queries::$name::Value<'tcx> = |
| 563 | FromCycleError::from_cycle_error(tcx, cycle, guar); | 469 | FromCycleError::from_cycle_error(tcx, cycle, guar); |
| 564 | erase::erase_val(result) | 470 | erase::erase_val(result) |
| 565 | }, | 471 | }, |
| 566 | hash_value_fn: if_no_hash!( | 472 | |
| 567 | [$($modifiers)*] | 473 | #[cfg($no_hash)] |
| 568 | None | 474 | hash_value_fn: None, |
| 569 | { | 475 | #[cfg(not($no_hash))] |
| 570 | Some(|hcx, erased_value: &erase::Erased<queries::$name::Value<'tcx>>| { | 476 | hash_value_fn: Some(|hcx, erased_value: &erase::Erased<queries::$name::Value<'tcx>>| { |
| 571 | let value = erase::restore_val(*erased_value); | 477 | let value = erase::restore_val(*erased_value); |
| 572 | rustc_middle::dep_graph::hash_result(hcx, &value) | 478 | rustc_middle::dep_graph::hash_result(hcx, &value) |
| 573 | }) | 479 | }), |
| 574 | } | 480 | |
| 575 | ), | ||
| 576 | format_value: |value| format!("{:?}", erase::restore_val::<queries::$name::Value<'tcx>>(*value)), | 481 | format_value: |value| format!("{:?}", erase::restore_val::<queries::$name::Value<'tcx>>(*value)), |
| 577 | description_fn: $crate::queries::_description_fns::$name, | 482 | description_fn: $crate::queries::_description_fns::$name, |
| 578 | execute_query_fn: if incremental { | 483 | execute_query_fn: if incremental { |
| ... | @@ -670,8 +575,8 @@ macro_rules! define_queries { | ... | @@ -670,8 +575,8 @@ macro_rules! define_queries { |
| 670 | query_result_index: &mut EncodedDepNodeIndex, | 575 | query_result_index: &mut EncodedDepNodeIndex, |
| 671 | ) { | 576 | ) { |
| 672 | $( | 577 | $( |
| 673 | item_if_cache_on_disk! { | 578 | #[cfg($cache_on_disk)] |
| 674 | [$($modifiers)*] | 579 | { |
| 675 | $crate::plumbing::encode_query_results( | 580 | $crate::plumbing::encode_query_results( |
| 676 | tcx, | 581 | tcx, |
| 677 | &tcx.query_system.query_vtables.$name, | 582 | &tcx.query_system.query_vtables.$name, |
compiler/rustc_resolve/src/diagnostics.rs+9-9| ... | @@ -2976,7 +2976,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | ... | @@ -2976,7 +2976,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2976 | corrections.push((import.span, format!("{module_name}::{import_snippet}"))); | 2976 | corrections.push((import.span, format!("{module_name}::{import_snippet}"))); |
| 2977 | } else { | 2977 | } else { |
| 2978 | // Find the binding span (and any trailing commas and spaces). | 2978 | // Find the binding span (and any trailing commas and spaces). |
| 2979 | // ie. `use a::b::{c, d, e};` | 2979 | // i.e. `use a::b::{c, d, e};` |
| 2980 | // ^^^ | 2980 | // ^^^ |
| 2981 | let (found_closing_brace, binding_span) = find_span_of_binding_until_next_binding( | 2981 | let (found_closing_brace, binding_span) = find_span_of_binding_until_next_binding( |
| 2982 | self.tcx.sess, | 2982 | self.tcx.sess, |
| ... | @@ -2988,11 +2988,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | ... | @@ -2988,11 +2988,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2988 | let mut removal_span = binding_span; | 2988 | let mut removal_span = binding_span; |
| 2989 | 2989 | ||
| 2990 | // If the binding span ended with a closing brace, as in the below example: | 2990 | // If the binding span ended with a closing brace, as in the below example: |
| 2991 | // ie. `use a::b::{c, d};` | 2991 | // i.e. `use a::b::{c, d};` |
| 2992 | // ^ | 2992 | // ^ |
| 2993 | // Then expand the span of characters to remove to include the previous | 2993 | // Then expand the span of characters to remove to include the previous |
| 2994 | // binding's trailing comma. | 2994 | // binding's trailing comma. |
| 2995 | // ie. `use a::b::{c, d};` | 2995 | // i.e. `use a::b::{c, d};` |
| 2996 | // ^^^ | 2996 | // ^^^ |
| 2997 | if found_closing_brace | 2997 | if found_closing_brace |
| 2998 | && let Some(previous_span) = | 2998 | && let Some(previous_span) = |
| ... | @@ -3008,7 +3008,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { | ... | @@ -3008,7 +3008,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 3008 | 3008 | ||
| 3009 | // Find the span after the crate name and if it has nested imports immediately | 3009 | // Find the span after the crate name and if it has nested imports immediately |
| 3010 | // after the crate name already. | 3010 | // after the crate name already. |
| 3011 | // ie. `use a::b::{c, d};` | 3011 | // i.e. `use a::b::{c, d};` |
| 3012 | // ^^^^^^^^^ | 3012 | // ^^^^^^^^^ |
| 3013 | // or `use a::{b, c, d}};` | 3013 | // or `use a::{b, c, d}};` |
| 3014 | // ^^^^^^^^^^^ | 3014 | // ^^^^^^^^^^^ |
| ... | @@ -3172,16 +3172,16 @@ fn find_span_of_binding_until_next_binding( | ... | @@ -3172,16 +3172,16 @@ fn find_span_of_binding_until_next_binding( |
| 3172 | let source_map = sess.source_map(); | 3172 | let source_map = sess.source_map(); |
| 3173 | 3173 | ||
| 3174 | // Find the span of everything after the binding. | 3174 | // Find the span of everything after the binding. |
| 3175 | // ie. `a, e};` or `a};` | 3175 | // i.e. `a, e};` or `a};` |
| 3176 | let binding_until_end = binding_span.with_hi(use_span.hi()); | 3176 | let binding_until_end = binding_span.with_hi(use_span.hi()); |
| 3177 | 3177 | ||
| 3178 | // Find everything after the binding but not including the binding. | 3178 | // Find everything after the binding but not including the binding. |
| 3179 | // ie. `, e};` or `};` | 3179 | // i.e. `, e};` or `};` |
| 3180 | let after_binding_until_end = binding_until_end.with_lo(binding_span.hi()); | 3180 | let after_binding_until_end = binding_until_end.with_lo(binding_span.hi()); |
| 3181 | 3181 | ||
| 3182 | // Keep characters in the span until we encounter something that isn't a comma or | 3182 | // Keep characters in the span until we encounter something that isn't a comma or |
| 3183 | // whitespace. | 3183 | // whitespace. |
| 3184 | // ie. `, ` or ``. | 3184 | // i.e. `, ` or ``. |
| 3185 | // | 3185 | // |
| 3186 | // Also note whether a closing brace character was encountered. If there | 3186 | // Also note whether a closing brace character was encountered. If there |
| 3187 | // was, then later go backwards to remove any trailing commas that are left. | 3187 | // was, then later go backwards to remove any trailing commas that are left. |
| ... | @@ -3195,7 +3195,7 @@ fn find_span_of_binding_until_next_binding( | ... | @@ -3195,7 +3195,7 @@ fn find_span_of_binding_until_next_binding( |
| 3195 | }); | 3195 | }); |
| 3196 | 3196 | ||
| 3197 | // Combine the two spans. | 3197 | // Combine the two spans. |
| 3198 | // ie. `a, ` or `a`. | 3198 | // i.e. `a, ` or `a`. |
| 3199 | // | 3199 | // |
| 3200 | // Removing these would leave `issue_52891::{d, e};` or `issue_52891::{d, e, };` | 3200 | // Removing these would leave `issue_52891::{d, e};` or `issue_52891::{d, e, };` |
| 3201 | let span = binding_span.with_hi(after_binding_until_next_binding.hi()); | 3201 | let span = binding_span.with_hi(after_binding_until_next_binding.hi()); |
| ... | @@ -3219,7 +3219,7 @@ fn extend_span_to_previous_binding(sess: &Session, binding_span: Span) -> Option | ... | @@ -3219,7 +3219,7 @@ fn extend_span_to_previous_binding(sess: &Session, binding_span: Span) -> Option |
| 3219 | let source_map = sess.source_map(); | 3219 | let source_map = sess.source_map(); |
| 3220 | 3220 | ||
| 3221 | // `prev_source` will contain all of the source that came before the span. | 3221 | // `prev_source` will contain all of the source that came before the span. |
| 3222 | // Then split based on a command and take the first (ie. closest to our span) | 3222 | // Then split based on a command and take the first (i.e. closest to our span) |
| 3223 | // snippet. In the example, this is a space. | 3223 | // snippet. In the example, this is a space. |
| 3224 | let prev_source = source_map.span_to_prev_source(binding_span).ok()?; | 3224 | let prev_source = source_map.span_to_prev_source(binding_span).ok()?; |
| 3225 | 3225 |
compiler/rustc_resolve/src/imports.rs+1-1| ... | @@ -70,7 +70,7 @@ pub(crate) enum ImportKind<'ra> { | ... | @@ -70,7 +70,7 @@ pub(crate) enum ImportKind<'ra> { |
| 70 | decls: PerNS<CmCell<PendingDecl<'ra>>>, | 70 | decls: PerNS<CmCell<PendingDecl<'ra>>>, |
| 71 | /// `true` for `...::{self [as target]}` imports, `false` otherwise. | 71 | /// `true` for `...::{self [as target]}` imports, `false` otherwise. |
| 72 | type_ns_only: bool, | 72 | type_ns_only: bool, |
| 73 | /// Did this import result from a nested import? ie. `use foo::{bar, baz};` | 73 | /// Did this import result from a nested import? i.e. `use foo::{bar, baz};` |
| 74 | nested: bool, | 74 | nested: bool, |
| 75 | /// The ID of the `UseTree` that imported this `Import`. | 75 | /// The ID of the `UseTree` that imported this `Import`. |
| 76 | /// | 76 | /// |
compiler/rustc_session/src/config/cfg.rs+1-1| ... | @@ -328,7 +328,7 @@ impl CheckCfg { | ... | @@ -328,7 +328,7 @@ impl CheckCfg { |
| 328 | return; | 328 | return; |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | // for `#[cfg(foo)]` (ie. cfg value is none) | 331 | // for `#[cfg(foo)]` (i.e. cfg value is none) |
| 332 | let no_values = || { | 332 | let no_values = || { |
| 333 | let mut values = FxHashSet::default(); | 333 | let mut values = FxHashSet::default(); |
| 334 | values.insert(None); | 334 | values.insert(None); |
compiler/rustc_span/src/symbol.rs+1| ... | @@ -1057,6 +1057,7 @@ symbols! { | ... | @@ -1057,6 +1057,7 @@ symbols! { |
| 1057 | immediate_abort: "immediate-abort", | 1057 | immediate_abort: "immediate-abort", |
| 1058 | impl_header_lifetime_elision, | 1058 | impl_header_lifetime_elision, |
| 1059 | impl_lint_pass, | 1059 | impl_lint_pass, |
| 1060 | impl_restriction, | ||
| 1060 | impl_trait_in_assoc_type, | 1061 | impl_trait_in_assoc_type, |
| 1061 | impl_trait_in_bindings, | 1062 | impl_trait_in_bindings, |
| 1062 | impl_trait_in_fn_trait_return, | 1063 | impl_trait_in_fn_trait_return, |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/find_anon_type.rs+1-1| ... | @@ -160,7 +160,7 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> { | ... | @@ -160,7 +160,7 @@ impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> { |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | // The visitor captures the corresponding `hir::Ty` of the anonymous region | 162 | // The visitor captures the corresponding `hir::Ty` of the anonymous region |
| 163 | // in the case of structs ie. `hir::TyKind::Path`. | 163 | // in the case of structs i.e. `hir::TyKind::Path`. |
| 164 | // This visitor would be invoked for each lifetime corresponding to a struct, | 164 | // This visitor would be invoked for each lifetime corresponding to a struct, |
| 165 | // and would walk the types like Vec<Ref> in the above example and Ref looking for the HIR | 165 | // and would walk the types like Vec<Ref> in the above example and Ref looking for the HIR |
| 166 | // where that lifetime appears. This allows us to highlight the | 166 | // where that lifetime appears. This allows us to highlight the |
library/std/src/fs.rs+2-2| ... | @@ -2680,7 +2680,7 @@ impl AsInner<fs_imp::DirEntry> for DirEntry { | ... | @@ -2680,7 +2680,7 @@ impl AsInner<fs_imp::DirEntry> for DirEntry { |
| 2680 | /// | 2680 | /// |
| 2681 | /// This function will only ever return an error of kind `NotFound` if the given | 2681 | /// This function will only ever return an error of kind `NotFound` if the given |
| 2682 | /// path does not exist. Note that the inverse is not true, | 2682 | /// path does not exist. Note that the inverse is not true, |
| 2683 | /// ie. if a path does not exist, its removal may fail for a number of reasons, | 2683 | /// i.e. if a path does not exist, its removal may fail for a number of reasons, |
| 2684 | /// such as insufficient permissions. | 2684 | /// such as insufficient permissions. |
| 2685 | /// | 2685 | /// |
| 2686 | /// # Examples | 2686 | /// # Examples |
| ... | @@ -3150,7 +3150,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { | ... | @@ -3150,7 +3150,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { |
| 3150 | /// | 3150 | /// |
| 3151 | /// This function will only ever return an error of kind `NotFound` if the given | 3151 | /// This function will only ever return an error of kind `NotFound` if the given |
| 3152 | /// path does not exist. Note that the inverse is not true, | 3152 | /// path does not exist. Note that the inverse is not true, |
| 3153 | /// ie. if a path does not exist, its removal may fail for a number of reasons, | 3153 | /// i.e. if a path does not exist, its removal may fail for a number of reasons, |
| 3154 | /// such as insufficient permissions. | 3154 | /// such as insufficient permissions. |
| 3155 | /// | 3155 | /// |
| 3156 | /// # Examples | 3156 | /// # Examples |
library/stdarch/Cargo.toml+1-1| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | [workspace] | 1 | [workspace] |
| 2 | resolver = "1" | 2 | resolver = "3" |
| 3 | members = [ | 3 | members = [ |
| 4 | "crates/*", | 4 | "crates/*", |
| 5 | "examples", | 5 | "examples", |
library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile+1-1| ... | @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ | ... | @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 12 | build-essential \ | 12 | build-essential \ |
| 13 | lld | 13 | lld |
| 14 | 14 | ||
| 15 | RUN wget http://ci-mirrors.rust-lang.org/stdarch/sde-external-9.58.0-2025-06-16-lin.tar.xz -O sde.tar.xz | 15 | RUN wget http://ci-mirrors.rust-lang.org/stdarch/sde-external-10.5.0-2026-01-13-lin.tar.xz -O sde.tar.xz |
| 16 | RUN mkdir intel-sde | 16 | RUN mkdir intel-sde |
| 17 | RUN tar -xJf sde.tar.xz --strip-components=1 -C intel-sde | 17 | RUN tar -xJf sde.tar.xz --strip-components=1 -C intel-sde |
| 18 | ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/intel-sde/sde64 \ | 18 | ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/intel-sde/sde64 \ |
library/stdarch/ci/docker/x86_64-unknown-linux-gnu/cpuid.def+2-1| ... | @@ -12,7 +12,7 @@ | ... | @@ -12,7 +12,7 @@ |
| 12 | # CPUID_VERSION = 1.0 | 12 | # CPUID_VERSION = 1.0 |
| 13 | # Input => Output | 13 | # Input => Output |
| 14 | # EAX ECX => EAX EBX ECX EDX | 14 | # EAX ECX => EAX EBX ECX EDX |
| 15 | 00000000 ******** => 00000024 756e6547 6c65746e 49656e69 | 15 | 00000000 ******** => 00000029 756e6547 6c65746e 49656e69 |
| 16 | 00000001 ******** => 00400f10 00100800 7ffaf3ff bfebfbff | 16 | 00000001 ******** => 00400f10 00100800 7ffaf3ff bfebfbff |
| 17 | 00000002 ******** => 76035a01 00f0b6ff 00000000 00c10000 | 17 | 00000002 ******** => 76035a01 00f0b6ff 00000000 00c10000 |
| 18 | 00000003 ******** => 00000000 00000000 00000000 00000000 | 18 | 00000003 ******** => 00000000 00000000 00000000 00000000 |
| ... | @@ -48,6 +48,7 @@ | ... | @@ -48,6 +48,7 @@ |
| 48 | 0000001e 00000001 => 000001ff 00000000 00000000 00000000 | 48 | 0000001e 00000001 => 000001ff 00000000 00000000 00000000 |
| 49 | 00000024 00000000 => 00000001 00070002 00000000 00000000 #AVX10 | 49 | 00000024 00000000 => 00000001 00070002 00000000 00000000 #AVX10 |
| 50 | 00000024 00000001 => 00000000 00000000 00000004 00000000 | 50 | 00000024 00000001 => 00000000 00000000 00000004 00000000 |
| 51 | 00000029 ******** => 00000000 00000001 00000000 00000000 | ||
| 51 | 80000000 ******** => 80000008 00000000 00000000 00000000 | 52 | 80000000 ******** => 80000008 00000000 00000000 00000000 |
| 52 | 80000001 ******** => 00000000 00000000 00000121 2c100000 | 53 | 80000001 ******** => 00000000 00000000 00000121 2c100000 |
| 53 | 80000002 ******** => 00000000 00000000 00000000 00000000 | 54 | 80000002 ******** => 00000000 00000000 00000000 00000000 |
library/stdarch/crates/core_arch/src/aarch64/neon/generated.rs+64-558| ... | @@ -14131,26 +14131,7 @@ pub fn vmlaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t | ... | @@ -14131,26 +14131,7 @@ pub fn vmlaq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t |
| 14131 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14131 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 14132 | pub fn vmlal_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t { | 14132 | pub fn vmlal_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t { |
| 14133 | static_assert_uimm_bits!(LANE, 2); | 14133 | static_assert_uimm_bits!(LANE, 2); |
| 14134 | unsafe { | 14134 | unsafe { vmlal_high_s16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14135 | vmlal_high_s16( | ||
| 14136 | a, | ||
| 14137 | b, | ||
| 14138 | simd_shuffle!( | ||
| 14139 | c, | ||
| 14140 | c, | ||
| 14141 | [ | ||
| 14142 | LANE as u32, | ||
| 14143 | LANE as u32, | ||
| 14144 | LANE as u32, | ||
| 14145 | LANE as u32, | ||
| 14146 | LANE as u32, | ||
| 14147 | LANE as u32, | ||
| 14148 | LANE as u32, | ||
| 14149 | LANE as u32 | ||
| 14150 | ] | ||
| 14151 | ), | ||
| 14152 | ) | ||
| 14153 | } | ||
| 14154 | } | 14135 | } |
| 14155 | #[doc = "Multiply-add long"] | 14136 | #[doc = "Multiply-add long"] |
| 14156 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_s16)"] | 14137 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_s16)"] |
| ... | @@ -14165,26 +14146,7 @@ pub fn vmlal_high_laneq_s16<const LANE: i32>( | ... | @@ -14165,26 +14146,7 @@ pub fn vmlal_high_laneq_s16<const LANE: i32>( |
| 14165 | c: int16x8_t, | 14146 | c: int16x8_t, |
| 14166 | ) -> int32x4_t { | 14147 | ) -> int32x4_t { |
| 14167 | static_assert_uimm_bits!(LANE, 3); | 14148 | static_assert_uimm_bits!(LANE, 3); |
| 14168 | unsafe { | 14149 | unsafe { vmlal_high_s16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14169 | vmlal_high_s16( | ||
| 14170 | a, | ||
| 14171 | b, | ||
| 14172 | simd_shuffle!( | ||
| 14173 | c, | ||
| 14174 | c, | ||
| 14175 | [ | ||
| 14176 | LANE as u32, | ||
| 14177 | LANE as u32, | ||
| 14178 | LANE as u32, | ||
| 14179 | LANE as u32, | ||
| 14180 | LANE as u32, | ||
| 14181 | LANE as u32, | ||
| 14182 | LANE as u32, | ||
| 14183 | LANE as u32 | ||
| 14184 | ] | ||
| 14185 | ), | ||
| 14186 | ) | ||
| 14187 | } | ||
| 14188 | } | 14150 | } |
| 14189 | #[doc = "Multiply-add long"] | 14151 | #[doc = "Multiply-add long"] |
| 14190 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_s32)"] | 14152 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_s32)"] |
| ... | @@ -14195,13 +14157,7 @@ pub fn vmlal_high_laneq_s16<const LANE: i32>( | ... | @@ -14195,13 +14157,7 @@ pub fn vmlal_high_laneq_s16<const LANE: i32>( |
| 14195 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14157 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 14196 | pub fn vmlal_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t { | 14158 | pub fn vmlal_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t { |
| 14197 | static_assert_uimm_bits!(LANE, 1); | 14159 | static_assert_uimm_bits!(LANE, 1); |
| 14198 | unsafe { | 14160 | unsafe { vmlal_high_s32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14199 | vmlal_high_s32( | ||
| 14200 | a, | ||
| 14201 | b, | ||
| 14202 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14203 | ) | ||
| 14204 | } | ||
| 14205 | } | 14161 | } |
| 14206 | #[doc = "Multiply-add long"] | 14162 | #[doc = "Multiply-add long"] |
| 14207 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_s32)"] | 14163 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_s32)"] |
| ... | @@ -14216,13 +14172,7 @@ pub fn vmlal_high_laneq_s32<const LANE: i32>( | ... | @@ -14216,13 +14172,7 @@ pub fn vmlal_high_laneq_s32<const LANE: i32>( |
| 14216 | c: int32x4_t, | 14172 | c: int32x4_t, |
| 14217 | ) -> int64x2_t { | 14173 | ) -> int64x2_t { |
| 14218 | static_assert_uimm_bits!(LANE, 2); | 14174 | static_assert_uimm_bits!(LANE, 2); |
| 14219 | unsafe { | 14175 | unsafe { vmlal_high_s32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14220 | vmlal_high_s32( | ||
| 14221 | a, | ||
| 14222 | b, | ||
| 14223 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14224 | ) | ||
| 14225 | } | ||
| 14226 | } | 14176 | } |
| 14227 | #[doc = "Multiply-add long"] | 14177 | #[doc = "Multiply-add long"] |
| 14228 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_u16)"] | 14178 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_u16)"] |
| ... | @@ -14237,26 +14187,7 @@ pub fn vmlal_high_lane_u16<const LANE: i32>( | ... | @@ -14237,26 +14187,7 @@ pub fn vmlal_high_lane_u16<const LANE: i32>( |
| 14237 | c: uint16x4_t, | 14187 | c: uint16x4_t, |
| 14238 | ) -> uint32x4_t { | 14188 | ) -> uint32x4_t { |
| 14239 | static_assert_uimm_bits!(LANE, 2); | 14189 | static_assert_uimm_bits!(LANE, 2); |
| 14240 | unsafe { | 14190 | unsafe { vmlal_high_u16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14241 | vmlal_high_u16( | ||
| 14242 | a, | ||
| 14243 | b, | ||
| 14244 | simd_shuffle!( | ||
| 14245 | c, | ||
| 14246 | c, | ||
| 14247 | [ | ||
| 14248 | LANE as u32, | ||
| 14249 | LANE as u32, | ||
| 14250 | LANE as u32, | ||
| 14251 | LANE as u32, | ||
| 14252 | LANE as u32, | ||
| 14253 | LANE as u32, | ||
| 14254 | LANE as u32, | ||
| 14255 | LANE as u32 | ||
| 14256 | ] | ||
| 14257 | ), | ||
| 14258 | ) | ||
| 14259 | } | ||
| 14260 | } | 14191 | } |
| 14261 | #[doc = "Multiply-add long"] | 14192 | #[doc = "Multiply-add long"] |
| 14262 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_u16)"] | 14193 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_u16)"] |
| ... | @@ -14271,26 +14202,7 @@ pub fn vmlal_high_laneq_u16<const LANE: i32>( | ... | @@ -14271,26 +14202,7 @@ pub fn vmlal_high_laneq_u16<const LANE: i32>( |
| 14271 | c: uint16x8_t, | 14202 | c: uint16x8_t, |
| 14272 | ) -> uint32x4_t { | 14203 | ) -> uint32x4_t { |
| 14273 | static_assert_uimm_bits!(LANE, 3); | 14204 | static_assert_uimm_bits!(LANE, 3); |
| 14274 | unsafe { | 14205 | unsafe { vmlal_high_u16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14275 | vmlal_high_u16( | ||
| 14276 | a, | ||
| 14277 | b, | ||
| 14278 | simd_shuffle!( | ||
| 14279 | c, | ||
| 14280 | c, | ||
| 14281 | [ | ||
| 14282 | LANE as u32, | ||
| 14283 | LANE as u32, | ||
| 14284 | LANE as u32, | ||
| 14285 | LANE as u32, | ||
| 14286 | LANE as u32, | ||
| 14287 | LANE as u32, | ||
| 14288 | LANE as u32, | ||
| 14289 | LANE as u32 | ||
| 14290 | ] | ||
| 14291 | ), | ||
| 14292 | ) | ||
| 14293 | } | ||
| 14294 | } | 14206 | } |
| 14295 | #[doc = "Multiply-add long"] | 14207 | #[doc = "Multiply-add long"] |
| 14296 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_u32)"] | 14208 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_lane_u32)"] |
| ... | @@ -14305,13 +14217,7 @@ pub fn vmlal_high_lane_u32<const LANE: i32>( | ... | @@ -14305,13 +14217,7 @@ pub fn vmlal_high_lane_u32<const LANE: i32>( |
| 14305 | c: uint32x2_t, | 14217 | c: uint32x2_t, |
| 14306 | ) -> uint64x2_t { | 14218 | ) -> uint64x2_t { |
| 14307 | static_assert_uimm_bits!(LANE, 1); | 14219 | static_assert_uimm_bits!(LANE, 1); |
| 14308 | unsafe { | 14220 | unsafe { vmlal_high_u32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14309 | vmlal_high_u32( | ||
| 14310 | a, | ||
| 14311 | b, | ||
| 14312 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14313 | ) | ||
| 14314 | } | ||
| 14315 | } | 14221 | } |
| 14316 | #[doc = "Multiply-add long"] | 14222 | #[doc = "Multiply-add long"] |
| 14317 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_u32)"] | 14223 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_laneq_u32)"] |
| ... | @@ -14326,13 +14232,7 @@ pub fn vmlal_high_laneq_u32<const LANE: i32>( | ... | @@ -14326,13 +14232,7 @@ pub fn vmlal_high_laneq_u32<const LANE: i32>( |
| 14326 | c: uint32x4_t, | 14232 | c: uint32x4_t, |
| 14327 | ) -> uint64x2_t { | 14233 | ) -> uint64x2_t { |
| 14328 | static_assert_uimm_bits!(LANE, 2); | 14234 | static_assert_uimm_bits!(LANE, 2); |
| 14329 | unsafe { | 14235 | unsafe { vmlal_high_u32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14330 | vmlal_high_u32( | ||
| 14331 | a, | ||
| 14332 | b, | ||
| 14333 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14334 | ) | ||
| 14335 | } | ||
| 14336 | } | 14236 | } |
| 14337 | #[doc = "Multiply-add long"] | 14237 | #[doc = "Multiply-add long"] |
| 14338 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_n_s16)"] | 14238 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlal_high_n_s16)"] |
| ... | @@ -14475,26 +14375,7 @@ pub fn vmlsq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t | ... | @@ -14475,26 +14375,7 @@ pub fn vmlsq_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t) -> float64x2_t |
| 14475 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14375 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 14476 | pub fn vmlsl_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t { | 14376 | pub fn vmlsl_high_lane_s16<const LANE: i32>(a: int32x4_t, b: int16x8_t, c: int16x4_t) -> int32x4_t { |
| 14477 | static_assert_uimm_bits!(LANE, 2); | 14377 | static_assert_uimm_bits!(LANE, 2); |
| 14478 | unsafe { | 14378 | unsafe { vmlsl_high_s16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14479 | vmlsl_high_s16( | ||
| 14480 | a, | ||
| 14481 | b, | ||
| 14482 | simd_shuffle!( | ||
| 14483 | c, | ||
| 14484 | c, | ||
| 14485 | [ | ||
| 14486 | LANE as u32, | ||
| 14487 | LANE as u32, | ||
| 14488 | LANE as u32, | ||
| 14489 | LANE as u32, | ||
| 14490 | LANE as u32, | ||
| 14491 | LANE as u32, | ||
| 14492 | LANE as u32, | ||
| 14493 | LANE as u32 | ||
| 14494 | ] | ||
| 14495 | ), | ||
| 14496 | ) | ||
| 14497 | } | ||
| 14498 | } | 14379 | } |
| 14499 | #[doc = "Multiply-subtract long"] | 14380 | #[doc = "Multiply-subtract long"] |
| 14500 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_s16)"] | 14381 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_s16)"] |
| ... | @@ -14509,26 +14390,7 @@ pub fn vmlsl_high_laneq_s16<const LANE: i32>( | ... | @@ -14509,26 +14390,7 @@ pub fn vmlsl_high_laneq_s16<const LANE: i32>( |
| 14509 | c: int16x8_t, | 14390 | c: int16x8_t, |
| 14510 | ) -> int32x4_t { | 14391 | ) -> int32x4_t { |
| 14511 | static_assert_uimm_bits!(LANE, 3); | 14392 | static_assert_uimm_bits!(LANE, 3); |
| 14512 | unsafe { | 14393 | unsafe { vmlsl_high_s16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14513 | vmlsl_high_s16( | ||
| 14514 | a, | ||
| 14515 | b, | ||
| 14516 | simd_shuffle!( | ||
| 14517 | c, | ||
| 14518 | c, | ||
| 14519 | [ | ||
| 14520 | LANE as u32, | ||
| 14521 | LANE as u32, | ||
| 14522 | LANE as u32, | ||
| 14523 | LANE as u32, | ||
| 14524 | LANE as u32, | ||
| 14525 | LANE as u32, | ||
| 14526 | LANE as u32, | ||
| 14527 | LANE as u32 | ||
| 14528 | ] | ||
| 14529 | ), | ||
| 14530 | ) | ||
| 14531 | } | ||
| 14532 | } | 14394 | } |
| 14533 | #[doc = "Multiply-subtract long"] | 14395 | #[doc = "Multiply-subtract long"] |
| 14534 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_s32)"] | 14396 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_s32)"] |
| ... | @@ -14539,13 +14401,7 @@ pub fn vmlsl_high_laneq_s16<const LANE: i32>( | ... | @@ -14539,13 +14401,7 @@ pub fn vmlsl_high_laneq_s16<const LANE: i32>( |
| 14539 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14401 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 14540 | pub fn vmlsl_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t { | 14402 | pub fn vmlsl_high_lane_s32<const LANE: i32>(a: int64x2_t, b: int32x4_t, c: int32x2_t) -> int64x2_t { |
| 14541 | static_assert_uimm_bits!(LANE, 1); | 14403 | static_assert_uimm_bits!(LANE, 1); |
| 14542 | unsafe { | 14404 | unsafe { vmlsl_high_s32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14543 | vmlsl_high_s32( | ||
| 14544 | a, | ||
| 14545 | b, | ||
| 14546 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14547 | ) | ||
| 14548 | } | ||
| 14549 | } | 14405 | } |
| 14550 | #[doc = "Multiply-subtract long"] | 14406 | #[doc = "Multiply-subtract long"] |
| 14551 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_s32)"] | 14407 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_s32)"] |
| ... | @@ -14560,13 +14416,7 @@ pub fn vmlsl_high_laneq_s32<const LANE: i32>( | ... | @@ -14560,13 +14416,7 @@ pub fn vmlsl_high_laneq_s32<const LANE: i32>( |
| 14560 | c: int32x4_t, | 14416 | c: int32x4_t, |
| 14561 | ) -> int64x2_t { | 14417 | ) -> int64x2_t { |
| 14562 | static_assert_uimm_bits!(LANE, 2); | 14418 | static_assert_uimm_bits!(LANE, 2); |
| 14563 | unsafe { | 14419 | unsafe { vmlsl_high_s32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14564 | vmlsl_high_s32( | ||
| 14565 | a, | ||
| 14566 | b, | ||
| 14567 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14568 | ) | ||
| 14569 | } | ||
| 14570 | } | 14420 | } |
| 14571 | #[doc = "Multiply-subtract long"] | 14421 | #[doc = "Multiply-subtract long"] |
| 14572 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_u16)"] | 14422 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_u16)"] |
| ... | @@ -14581,26 +14431,7 @@ pub fn vmlsl_high_lane_u16<const LANE: i32>( | ... | @@ -14581,26 +14431,7 @@ pub fn vmlsl_high_lane_u16<const LANE: i32>( |
| 14581 | c: uint16x4_t, | 14431 | c: uint16x4_t, |
| 14582 | ) -> uint32x4_t { | 14432 | ) -> uint32x4_t { |
| 14583 | static_assert_uimm_bits!(LANE, 2); | 14433 | static_assert_uimm_bits!(LANE, 2); |
| 14584 | unsafe { | 14434 | unsafe { vmlsl_high_u16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14585 | vmlsl_high_u16( | ||
| 14586 | a, | ||
| 14587 | b, | ||
| 14588 | simd_shuffle!( | ||
| 14589 | c, | ||
| 14590 | c, | ||
| 14591 | [ | ||
| 14592 | LANE as u32, | ||
| 14593 | LANE as u32, | ||
| 14594 | LANE as u32, | ||
| 14595 | LANE as u32, | ||
| 14596 | LANE as u32, | ||
| 14597 | LANE as u32, | ||
| 14598 | LANE as u32, | ||
| 14599 | LANE as u32 | ||
| 14600 | ] | ||
| 14601 | ), | ||
| 14602 | ) | ||
| 14603 | } | ||
| 14604 | } | 14435 | } |
| 14605 | #[doc = "Multiply-subtract long"] | 14436 | #[doc = "Multiply-subtract long"] |
| 14606 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_u16)"] | 14437 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_u16)"] |
| ... | @@ -14615,26 +14446,7 @@ pub fn vmlsl_high_laneq_u16<const LANE: i32>( | ... | @@ -14615,26 +14446,7 @@ pub fn vmlsl_high_laneq_u16<const LANE: i32>( |
| 14615 | c: uint16x8_t, | 14446 | c: uint16x8_t, |
| 14616 | ) -> uint32x4_t { | 14447 | ) -> uint32x4_t { |
| 14617 | static_assert_uimm_bits!(LANE, 3); | 14448 | static_assert_uimm_bits!(LANE, 3); |
| 14618 | unsafe { | 14449 | unsafe { vmlsl_high_u16(a, b, simd_shuffle!(c, c, [LANE as u32; 8])) } |
| 14619 | vmlsl_high_u16( | ||
| 14620 | a, | ||
| 14621 | b, | ||
| 14622 | simd_shuffle!( | ||
| 14623 | c, | ||
| 14624 | c, | ||
| 14625 | [ | ||
| 14626 | LANE as u32, | ||
| 14627 | LANE as u32, | ||
| 14628 | LANE as u32, | ||
| 14629 | LANE as u32, | ||
| 14630 | LANE as u32, | ||
| 14631 | LANE as u32, | ||
| 14632 | LANE as u32, | ||
| 14633 | LANE as u32 | ||
| 14634 | ] | ||
| 14635 | ), | ||
| 14636 | ) | ||
| 14637 | } | ||
| 14638 | } | 14450 | } |
| 14639 | #[doc = "Multiply-subtract long"] | 14451 | #[doc = "Multiply-subtract long"] |
| 14640 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_u32)"] | 14452 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_lane_u32)"] |
| ... | @@ -14649,13 +14461,7 @@ pub fn vmlsl_high_lane_u32<const LANE: i32>( | ... | @@ -14649,13 +14461,7 @@ pub fn vmlsl_high_lane_u32<const LANE: i32>( |
| 14649 | c: uint32x2_t, | 14461 | c: uint32x2_t, |
| 14650 | ) -> uint64x2_t { | 14462 | ) -> uint64x2_t { |
| 14651 | static_assert_uimm_bits!(LANE, 1); | 14463 | static_assert_uimm_bits!(LANE, 1); |
| 14652 | unsafe { | 14464 | unsafe { vmlsl_high_u32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14653 | vmlsl_high_u32( | ||
| 14654 | a, | ||
| 14655 | b, | ||
| 14656 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14657 | ) | ||
| 14658 | } | ||
| 14659 | } | 14465 | } |
| 14660 | #[doc = "Multiply-subtract long"] | 14466 | #[doc = "Multiply-subtract long"] |
| 14661 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_u32)"] | 14467 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_laneq_u32)"] |
| ... | @@ -14670,13 +14476,7 @@ pub fn vmlsl_high_laneq_u32<const LANE: i32>( | ... | @@ -14670,13 +14476,7 @@ pub fn vmlsl_high_laneq_u32<const LANE: i32>( |
| 14670 | c: uint32x4_t, | 14476 | c: uint32x4_t, |
| 14671 | ) -> uint64x2_t { | 14477 | ) -> uint64x2_t { |
| 14672 | static_assert_uimm_bits!(LANE, 2); | 14478 | static_assert_uimm_bits!(LANE, 2); |
| 14673 | unsafe { | 14479 | unsafe { vmlsl_high_u32(a, b, simd_shuffle!(c, c, [LANE as u32; 4])) } |
| 14674 | vmlsl_high_u32( | ||
| 14675 | a, | ||
| 14676 | b, | ||
| 14677 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14678 | ) | ||
| 14679 | } | ||
| 14680 | } | 14480 | } |
| 14681 | #[doc = "Multiply-subtract long"] | 14481 | #[doc = "Multiply-subtract long"] |
| 14682 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_n_s16)"] | 14482 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmlsl_high_n_s16)"] |
| ... | @@ -14975,12 +14775,7 @@ pub fn vmul_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t) -> float64 | ... | @@ -14975,12 +14775,7 @@ pub fn vmul_lane_f64<const LANE: i32>(a: float64x1_t, b: float64x1_t) -> float64 |
| 14975 | #[cfg(not(target_arch = "arm64ec"))] | 14775 | #[cfg(not(target_arch = "arm64ec"))] |
| 14976 | pub fn vmul_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t { | 14776 | pub fn vmul_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t { |
| 14977 | static_assert_uimm_bits!(LANE, 3); | 14777 | static_assert_uimm_bits!(LANE, 3); |
| 14978 | unsafe { | 14778 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 14979 | simd_mul( | ||
| 14980 | a, | ||
| 14981 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 14982 | ) | ||
| 14983 | } | ||
| 14984 | } | 14779 | } |
| 14985 | #[doc = "Floating-point multiply"] | 14780 | #[doc = "Floating-point multiply"] |
| 14986 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulq_laneq_f16)"] | 14781 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulq_laneq_f16)"] |
| ... | @@ -14992,25 +14787,7 @@ pub fn vmul_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float1 | ... | @@ -14992,25 +14787,7 @@ pub fn vmul_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float1 |
| 14992 | #[cfg(not(target_arch = "arm64ec"))] | 14787 | #[cfg(not(target_arch = "arm64ec"))] |
| 14993 | pub fn vmulq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t { | 14788 | pub fn vmulq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t { |
| 14994 | static_assert_uimm_bits!(LANE, 3); | 14789 | static_assert_uimm_bits!(LANE, 3); |
| 14995 | unsafe { | 14790 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 14996 | simd_mul( | ||
| 14997 | a, | ||
| 14998 | simd_shuffle!( | ||
| 14999 | b, | ||
| 15000 | b, | ||
| 15001 | [ | ||
| 15002 | LANE as u32, | ||
| 15003 | LANE as u32, | ||
| 15004 | LANE as u32, | ||
| 15005 | LANE as u32, | ||
| 15006 | LANE as u32, | ||
| 15007 | LANE as u32, | ||
| 15008 | LANE as u32, | ||
| 15009 | LANE as u32 | ||
| 15010 | ] | ||
| 15011 | ), | ||
| 15012 | ) | ||
| 15013 | } | ||
| 15014 | } | 14791 | } |
| 15015 | #[doc = "Floating-point multiply"] | 14792 | #[doc = "Floating-point multiply"] |
| 15016 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmul_laneq_f64)"] | 14793 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmul_laneq_f64)"] |
| ... | @@ -15104,25 +14881,7 @@ pub fn vmulh_laneq_f16<const LANE: i32>(a: f16, b: float16x8_t) -> f16 { | ... | @@ -15104,25 +14881,7 @@ pub fn vmulh_laneq_f16<const LANE: i32>(a: f16, b: float16x8_t) -> f16 { |
| 15104 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14881 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15105 | pub fn vmull_high_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int32x4_t { | 14882 | pub fn vmull_high_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int32x4_t { |
| 15106 | static_assert_uimm_bits!(LANE, 2); | 14883 | static_assert_uimm_bits!(LANE, 2); |
| 15107 | unsafe { | 14884 | unsafe { vmull_high_s16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15108 | vmull_high_s16( | ||
| 15109 | a, | ||
| 15110 | simd_shuffle!( | ||
| 15111 | b, | ||
| 15112 | b, | ||
| 15113 | [ | ||
| 15114 | LANE as u32, | ||
| 15115 | LANE as u32, | ||
| 15116 | LANE as u32, | ||
| 15117 | LANE as u32, | ||
| 15118 | LANE as u32, | ||
| 15119 | LANE as u32, | ||
| 15120 | LANE as u32, | ||
| 15121 | LANE as u32 | ||
| 15122 | ] | ||
| 15123 | ), | ||
| 15124 | ) | ||
| 15125 | } | ||
| 15126 | } | 14885 | } |
| 15127 | #[doc = "Multiply long"] | 14886 | #[doc = "Multiply long"] |
| 15128 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_s16)"] | 14887 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_s16)"] |
| ... | @@ -15133,25 +14892,7 @@ pub fn vmull_high_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int32 | ... | @@ -15133,25 +14892,7 @@ pub fn vmull_high_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x4_t) -> int32 |
| 15133 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14892 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15134 | pub fn vmull_high_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int32x4_t { | 14893 | pub fn vmull_high_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int32x4_t { |
| 15135 | static_assert_uimm_bits!(LANE, 3); | 14894 | static_assert_uimm_bits!(LANE, 3); |
| 15136 | unsafe { | 14895 | unsafe { vmull_high_s16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15137 | vmull_high_s16( | ||
| 15138 | a, | ||
| 15139 | simd_shuffle!( | ||
| 15140 | b, | ||
| 15141 | b, | ||
| 15142 | [ | ||
| 15143 | LANE as u32, | ||
| 15144 | LANE as u32, | ||
| 15145 | LANE as u32, | ||
| 15146 | LANE as u32, | ||
| 15147 | LANE as u32, | ||
| 15148 | LANE as u32, | ||
| 15149 | LANE as u32, | ||
| 15150 | LANE as u32 | ||
| 15151 | ] | ||
| 15152 | ), | ||
| 15153 | ) | ||
| 15154 | } | ||
| 15155 | } | 14896 | } |
| 15156 | #[doc = "Multiply long"] | 14897 | #[doc = "Multiply long"] |
| 15157 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_s32)"] | 14898 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_s32)"] |
| ... | @@ -15162,12 +14903,7 @@ pub fn vmull_high_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int3 | ... | @@ -15162,12 +14903,7 @@ pub fn vmull_high_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t) -> int3 |
| 15162 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14903 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15163 | pub fn vmull_high_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int64x2_t { | 14904 | pub fn vmull_high_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int64x2_t { |
| 15164 | static_assert_uimm_bits!(LANE, 1); | 14905 | static_assert_uimm_bits!(LANE, 1); |
| 15165 | unsafe { | 14906 | unsafe { vmull_high_s32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15166 | vmull_high_s32( | ||
| 15167 | a, | ||
| 15168 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15169 | ) | ||
| 15170 | } | ||
| 15171 | } | 14907 | } |
| 15172 | #[doc = "Multiply long"] | 14908 | #[doc = "Multiply long"] |
| 15173 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_s32)"] | 14909 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_s32)"] |
| ... | @@ -15178,12 +14914,7 @@ pub fn vmull_high_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int64 | ... | @@ -15178,12 +14914,7 @@ pub fn vmull_high_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x2_t) -> int64 |
| 15178 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14914 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15179 | pub fn vmull_high_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int64x2_t { | 14915 | pub fn vmull_high_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int64x2_t { |
| 15180 | static_assert_uimm_bits!(LANE, 2); | 14916 | static_assert_uimm_bits!(LANE, 2); |
| 15181 | unsafe { | 14917 | unsafe { vmull_high_s32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15182 | vmull_high_s32( | ||
| 15183 | a, | ||
| 15184 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15185 | ) | ||
| 15186 | } | ||
| 15187 | } | 14918 | } |
| 15188 | #[doc = "Multiply long"] | 14919 | #[doc = "Multiply long"] |
| 15189 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_u16)"] | 14920 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_u16)"] |
| ... | @@ -15194,25 +14925,7 @@ pub fn vmull_high_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int6 | ... | @@ -15194,25 +14925,7 @@ pub fn vmull_high_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t) -> int6 |
| 15194 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14925 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15195 | pub fn vmull_high_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uint32x4_t { | 14926 | pub fn vmull_high_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uint32x4_t { |
| 15196 | static_assert_uimm_bits!(LANE, 2); | 14927 | static_assert_uimm_bits!(LANE, 2); |
| 15197 | unsafe { | 14928 | unsafe { vmull_high_u16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15198 | vmull_high_u16( | ||
| 15199 | a, | ||
| 15200 | simd_shuffle!( | ||
| 15201 | b, | ||
| 15202 | b, | ||
| 15203 | [ | ||
| 15204 | LANE as u32, | ||
| 15205 | LANE as u32, | ||
| 15206 | LANE as u32, | ||
| 15207 | LANE as u32, | ||
| 15208 | LANE as u32, | ||
| 15209 | LANE as u32, | ||
| 15210 | LANE as u32, | ||
| 15211 | LANE as u32 | ||
| 15212 | ] | ||
| 15213 | ), | ||
| 15214 | ) | ||
| 15215 | } | ||
| 15216 | } | 14929 | } |
| 15217 | #[doc = "Multiply long"] | 14930 | #[doc = "Multiply long"] |
| 15218 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_u16)"] | 14931 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_u16)"] |
| ... | @@ -15223,25 +14936,7 @@ pub fn vmull_high_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uin | ... | @@ -15223,25 +14936,7 @@ pub fn vmull_high_lane_u16<const LANE: i32>(a: uint16x8_t, b: uint16x4_t) -> uin |
| 15223 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14936 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15224 | pub fn vmull_high_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { | 14937 | pub fn vmull_high_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> uint32x4_t { |
| 15225 | static_assert_uimm_bits!(LANE, 3); | 14938 | static_assert_uimm_bits!(LANE, 3); |
| 15226 | unsafe { | 14939 | unsafe { vmull_high_u16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15227 | vmull_high_u16( | ||
| 15228 | a, | ||
| 15229 | simd_shuffle!( | ||
| 15230 | b, | ||
| 15231 | b, | ||
| 15232 | [ | ||
| 15233 | LANE as u32, | ||
| 15234 | LANE as u32, | ||
| 15235 | LANE as u32, | ||
| 15236 | LANE as u32, | ||
| 15237 | LANE as u32, | ||
| 15238 | LANE as u32, | ||
| 15239 | LANE as u32, | ||
| 15240 | LANE as u32 | ||
| 15241 | ] | ||
| 15242 | ), | ||
| 15243 | ) | ||
| 15244 | } | ||
| 15245 | } | 14940 | } |
| 15246 | #[doc = "Multiply long"] | 14941 | #[doc = "Multiply long"] |
| 15247 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_u32)"] | 14942 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_lane_u32)"] |
| ... | @@ -15252,12 +14947,7 @@ pub fn vmull_high_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> ui | ... | @@ -15252,12 +14947,7 @@ pub fn vmull_high_laneq_u16<const LANE: i32>(a: uint16x8_t, b: uint16x8_t) -> ui |
| 15252 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14947 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15253 | pub fn vmull_high_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uint64x2_t { | 14948 | pub fn vmull_high_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uint64x2_t { |
| 15254 | static_assert_uimm_bits!(LANE, 1); | 14949 | static_assert_uimm_bits!(LANE, 1); |
| 15255 | unsafe { | 14950 | unsafe { vmull_high_u32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15256 | vmull_high_u32( | ||
| 15257 | a, | ||
| 15258 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15259 | ) | ||
| 15260 | } | ||
| 15261 | } | 14951 | } |
| 15262 | #[doc = "Multiply long"] | 14952 | #[doc = "Multiply long"] |
| 15263 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_u32)"] | 14953 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_laneq_u32)"] |
| ... | @@ -15268,12 +14958,7 @@ pub fn vmull_high_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uin | ... | @@ -15268,12 +14958,7 @@ pub fn vmull_high_lane_u32<const LANE: i32>(a: uint32x4_t, b: uint32x2_t) -> uin |
| 15268 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 14958 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15269 | pub fn vmull_high_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t { | 14959 | pub fn vmull_high_laneq_u32<const LANE: i32>(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t { |
| 15270 | static_assert_uimm_bits!(LANE, 2); | 14960 | static_assert_uimm_bits!(LANE, 2); |
| 15271 | unsafe { | 14961 | unsafe { vmull_high_u32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15272 | vmull_high_u32( | ||
| 15273 | a, | ||
| 15274 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15275 | ) | ||
| 15276 | } | ||
| 15277 | } | 14962 | } |
| 15278 | #[doc = "Multiply long"] | 14963 | #[doc = "Multiply long"] |
| 15279 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_n_s16)"] | 14964 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmull_high_n_s16)"] |
| ... | @@ -15436,7 +15121,7 @@ pub fn vmull_p64(a: p64, b: p64) -> p128 { | ... | @@ -15436,7 +15121,7 @@ pub fn vmull_p64(a: p64, b: p64) -> p128 { |
| 15436 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15121 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15437 | pub fn vmulq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t { | 15122 | pub fn vmulq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t { |
| 15438 | static_assert!(LANE == 0); | 15123 | static_assert!(LANE == 0); |
| 15439 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15124 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15440 | } | 15125 | } |
| 15441 | #[doc = "Floating-point multiply"] | 15126 | #[doc = "Floating-point multiply"] |
| 15442 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulq_laneq_f64)"] | 15127 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulq_laneq_f64)"] |
| ... | @@ -15447,7 +15132,7 @@ pub fn vmulq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float6 | ... | @@ -15447,7 +15132,7 @@ pub fn vmulq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float6 |
| 15447 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15132 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15448 | pub fn vmulq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t { | 15133 | pub fn vmulq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t { |
| 15449 | static_assert_uimm_bits!(LANE, 1); | 15134 | static_assert_uimm_bits!(LANE, 1); |
| 15450 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15135 | unsafe { simd_mul(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15451 | } | 15136 | } |
| 15452 | #[doc = "Floating-point multiply"] | 15137 | #[doc = "Floating-point multiply"] |
| 15453 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmuls_lane_f32)"] | 15138 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmuls_lane_f32)"] |
| ... | @@ -15599,12 +15284,7 @@ pub fn vmulxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { | ... | @@ -15599,12 +15284,7 @@ pub fn vmulxq_f64(a: float64x2_t, b: float64x2_t) -> float64x2_t { |
| 15599 | #[cfg(not(target_arch = "arm64ec"))] | 15284 | #[cfg(not(target_arch = "arm64ec"))] |
| 15600 | pub fn vmulx_lane_f16<const LANE: i32>(a: float16x4_t, b: float16x4_t) -> float16x4_t { | 15285 | pub fn vmulx_lane_f16<const LANE: i32>(a: float16x4_t, b: float16x4_t) -> float16x4_t { |
| 15601 | static_assert_uimm_bits!(LANE, 2); | 15286 | static_assert_uimm_bits!(LANE, 2); |
| 15602 | unsafe { | 15287 | unsafe { vmulx_f16(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15603 | vmulx_f16( | ||
| 15604 | a, | ||
| 15605 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15606 | ) | ||
| 15607 | } | ||
| 15608 | } | 15288 | } |
| 15609 | #[doc = "Floating-point multiply extended"] | 15289 | #[doc = "Floating-point multiply extended"] |
| 15610 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_laneq_f16)"] | 15290 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_laneq_f16)"] |
| ... | @@ -15616,12 +15296,7 @@ pub fn vmulx_lane_f16<const LANE: i32>(a: float16x4_t, b: float16x4_t) -> float1 | ... | @@ -15616,12 +15296,7 @@ pub fn vmulx_lane_f16<const LANE: i32>(a: float16x4_t, b: float16x4_t) -> float1 |
| 15616 | #[cfg(not(target_arch = "arm64ec"))] | 15296 | #[cfg(not(target_arch = "arm64ec"))] |
| 15617 | pub fn vmulx_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t { | 15297 | pub fn vmulx_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t { |
| 15618 | static_assert_uimm_bits!(LANE, 3); | 15298 | static_assert_uimm_bits!(LANE, 3); |
| 15619 | unsafe { | 15299 | unsafe { vmulx_f16(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15620 | vmulx_f16( | ||
| 15621 | a, | ||
| 15622 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15623 | ) | ||
| 15624 | } | ||
| 15625 | } | 15300 | } |
| 15626 | #[doc = "Floating-point multiply extended"] | 15301 | #[doc = "Floating-point multiply extended"] |
| 15627 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_lane_f16)"] | 15302 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_lane_f16)"] |
| ... | @@ -15633,25 +15308,7 @@ pub fn vmulx_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float | ... | @@ -15633,25 +15308,7 @@ pub fn vmulx_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float |
| 15633 | #[cfg(not(target_arch = "arm64ec"))] | 15308 | #[cfg(not(target_arch = "arm64ec"))] |
| 15634 | pub fn vmulxq_lane_f16<const LANE: i32>(a: float16x8_t, b: float16x4_t) -> float16x8_t { | 15309 | pub fn vmulxq_lane_f16<const LANE: i32>(a: float16x8_t, b: float16x4_t) -> float16x8_t { |
| 15635 | static_assert_uimm_bits!(LANE, 2); | 15310 | static_assert_uimm_bits!(LANE, 2); |
| 15636 | unsafe { | 15311 | unsafe { vmulxq_f16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15637 | vmulxq_f16( | ||
| 15638 | a, | ||
| 15639 | simd_shuffle!( | ||
| 15640 | b, | ||
| 15641 | b, | ||
| 15642 | [ | ||
| 15643 | LANE as u32, | ||
| 15644 | LANE as u32, | ||
| 15645 | LANE as u32, | ||
| 15646 | LANE as u32, | ||
| 15647 | LANE as u32, | ||
| 15648 | LANE as u32, | ||
| 15649 | LANE as u32, | ||
| 15650 | LANE as u32 | ||
| 15651 | ] | ||
| 15652 | ), | ||
| 15653 | ) | ||
| 15654 | } | ||
| 15655 | } | 15312 | } |
| 15656 | #[doc = "Floating-point multiply extended"] | 15313 | #[doc = "Floating-point multiply extended"] |
| 15657 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f16)"] | 15314 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f16)"] |
| ... | @@ -15663,25 +15320,7 @@ pub fn vmulxq_lane_f16<const LANE: i32>(a: float16x8_t, b: float16x4_t) -> float | ... | @@ -15663,25 +15320,7 @@ pub fn vmulxq_lane_f16<const LANE: i32>(a: float16x8_t, b: float16x4_t) -> float |
| 15663 | #[cfg(not(target_arch = "arm64ec"))] | 15320 | #[cfg(not(target_arch = "arm64ec"))] |
| 15664 | pub fn vmulxq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t { | 15321 | pub fn vmulxq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t { |
| 15665 | static_assert_uimm_bits!(LANE, 3); | 15322 | static_assert_uimm_bits!(LANE, 3); |
| 15666 | unsafe { | 15323 | unsafe { vmulxq_f16(a, simd_shuffle!(b, b, [LANE as u32; 8])) } |
| 15667 | vmulxq_f16( | ||
| 15668 | a, | ||
| 15669 | simd_shuffle!( | ||
| 15670 | b, | ||
| 15671 | b, | ||
| 15672 | [ | ||
| 15673 | LANE as u32, | ||
| 15674 | LANE as u32, | ||
| 15675 | LANE as u32, | ||
| 15676 | LANE as u32, | ||
| 15677 | LANE as u32, | ||
| 15678 | LANE as u32, | ||
| 15679 | LANE as u32, | ||
| 15680 | LANE as u32 | ||
| 15681 | ] | ||
| 15682 | ), | ||
| 15683 | ) | ||
| 15684 | } | ||
| 15685 | } | 15324 | } |
| 15686 | #[doc = "Floating-point multiply extended"] | 15325 | #[doc = "Floating-point multiply extended"] |
| 15687 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_lane_f32)"] | 15326 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_lane_f32)"] |
| ... | @@ -15692,7 +15331,7 @@ pub fn vmulxq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> floa | ... | @@ -15692,7 +15331,7 @@ pub fn vmulxq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> floa |
| 15692 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15331 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15693 | pub fn vmulx_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t { | 15332 | pub fn vmulx_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float32x2_t { |
| 15694 | static_assert_uimm_bits!(LANE, 1); | 15333 | static_assert_uimm_bits!(LANE, 1); |
| 15695 | unsafe { vmulx_f32(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15334 | unsafe { vmulx_f32(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15696 | } | 15335 | } |
| 15697 | #[doc = "Floating-point multiply extended"] | 15336 | #[doc = "Floating-point multiply extended"] |
| 15698 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_laneq_f32)"] | 15337 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_laneq_f32)"] |
| ... | @@ -15703,7 +15342,7 @@ pub fn vmulx_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float3 | ... | @@ -15703,7 +15342,7 @@ pub fn vmulx_lane_f32<const LANE: i32>(a: float32x2_t, b: float32x2_t) -> float3 |
| 15703 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15342 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15704 | pub fn vmulx_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float32x2_t { | 15343 | pub fn vmulx_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float32x2_t { |
| 15705 | static_assert_uimm_bits!(LANE, 2); | 15344 | static_assert_uimm_bits!(LANE, 2); |
| 15706 | unsafe { vmulx_f32(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15345 | unsafe { vmulx_f32(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15707 | } | 15346 | } |
| 15708 | #[doc = "Floating-point multiply extended"] | 15347 | #[doc = "Floating-point multiply extended"] |
| 15709 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_lane_f32)"] | 15348 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_lane_f32)"] |
| ... | @@ -15714,12 +15353,7 @@ pub fn vmulx_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float | ... | @@ -15714,12 +15353,7 @@ pub fn vmulx_laneq_f32<const LANE: i32>(a: float32x2_t, b: float32x4_t) -> float |
| 15714 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15353 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15715 | pub fn vmulxq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float32x4_t { | 15354 | pub fn vmulxq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float32x4_t { |
| 15716 | static_assert_uimm_bits!(LANE, 1); | 15355 | static_assert_uimm_bits!(LANE, 1); |
| 15717 | unsafe { | 15356 | unsafe { vmulxq_f32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15718 | vmulxq_f32( | ||
| 15719 | a, | ||
| 15720 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15721 | ) | ||
| 15722 | } | ||
| 15723 | } | 15357 | } |
| 15724 | #[doc = "Floating-point multiply extended"] | 15358 | #[doc = "Floating-point multiply extended"] |
| 15725 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f32)"] | 15359 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f32)"] |
| ... | @@ -15730,12 +15364,7 @@ pub fn vmulxq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float | ... | @@ -15730,12 +15364,7 @@ pub fn vmulxq_lane_f32<const LANE: i32>(a: float32x4_t, b: float32x2_t) -> float |
| 15730 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15364 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15731 | pub fn vmulxq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t { | 15365 | pub fn vmulxq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> float32x4_t { |
| 15732 | static_assert_uimm_bits!(LANE, 2); | 15366 | static_assert_uimm_bits!(LANE, 2); |
| 15733 | unsafe { | 15367 | unsafe { vmulxq_f32(a, simd_shuffle!(b, b, [LANE as u32; 4])) } |
| 15734 | vmulxq_f32( | ||
| 15735 | a, | ||
| 15736 | simd_shuffle!(b, b, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]), | ||
| 15737 | ) | ||
| 15738 | } | ||
| 15739 | } | 15368 | } |
| 15740 | #[doc = "Floating-point multiply extended"] | 15369 | #[doc = "Floating-point multiply extended"] |
| 15741 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f64)"] | 15370 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulxq_laneq_f64)"] |
| ... | @@ -15746,7 +15375,7 @@ pub fn vmulxq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> floa | ... | @@ -15746,7 +15375,7 @@ pub fn vmulxq_laneq_f32<const LANE: i32>(a: float32x4_t, b: float32x4_t) -> floa |
| 15746 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15375 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15747 | pub fn vmulxq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t { | 15376 | pub fn vmulxq_laneq_f64<const LANE: i32>(a: float64x2_t, b: float64x2_t) -> float64x2_t { |
| 15748 | static_assert_uimm_bits!(LANE, 1); | 15377 | static_assert_uimm_bits!(LANE, 1); |
| 15749 | unsafe { vmulxq_f64(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15378 | unsafe { vmulxq_f64(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15750 | } | 15379 | } |
| 15751 | #[doc = "Floating-point multiply extended"] | 15380 | #[doc = "Floating-point multiply extended"] |
| 15752 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_lane_f64)"] | 15381 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_lane_f64)"] |
| ... | @@ -15916,7 +15545,7 @@ pub fn vmulxh_laneq_f16<const LANE: i32>(a: f16, b: float16x8_t) -> f16 { | ... | @@ -15916,7 +15545,7 @@ pub fn vmulxh_laneq_f16<const LANE: i32>(a: f16, b: float16x8_t) -> f16 { |
| 15916 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 15545 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 15917 | pub fn vmulxq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t { | 15546 | pub fn vmulxq_lane_f64<const LANE: i32>(a: float64x2_t, b: float64x1_t) -> float64x2_t { |
| 15918 | static_assert!(LANE == 0); | 15547 | static_assert!(LANE == 0); |
| 15919 | unsafe { vmulxq_f64(a, simd_shuffle!(b, b, [LANE as u32, LANE as u32])) } | 15548 | unsafe { vmulxq_f64(a, simd_shuffle!(b, b, [LANE as u32; 2])) } |
| 15920 | } | 15549 | } |
| 15921 | #[doc = "Negate"] | 15550 | #[doc = "Negate"] |
| 15922 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vneg_f64)"] | 15551 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vneg_f64)"] |
| ... | @@ -17916,8 +17545,7 @@ pub fn vqnegd_s64(a: i64) -> i64 { | ... | @@ -17916,8 +17545,7 @@ pub fn vqnegd_s64(a: i64) -> i64 { |
| 17916 | pub fn vqrdmlah_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t { | 17545 | pub fn vqrdmlah_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t { |
| 17917 | static_assert_uimm_bits!(LANE, 2); | 17546 | static_assert_uimm_bits!(LANE, 2); |
| 17918 | unsafe { | 17547 | unsafe { |
| 17919 | let c: int16x4_t = | 17548 | let c: int16x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 17920 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 17921 | vqrdmlah_s16(a, b, c) | 17549 | vqrdmlah_s16(a, b, c) |
| 17922 | } | 17550 | } |
| 17923 | } | 17551 | } |
| ... | @@ -17931,7 +17559,7 @@ pub fn vqrdmlah_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4 | ... | @@ -17931,7 +17559,7 @@ pub fn vqrdmlah_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4 |
| 17931 | pub fn vqrdmlah_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t { | 17559 | pub fn vqrdmlah_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t { |
| 17932 | static_assert_uimm_bits!(LANE, 1); | 17560 | static_assert_uimm_bits!(LANE, 1); |
| 17933 | unsafe { | 17561 | unsafe { |
| 17934 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); | 17562 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32; 2]); |
| 17935 | vqrdmlah_s32(a, b, c) | 17563 | vqrdmlah_s32(a, b, c) |
| 17936 | } | 17564 | } |
| 17937 | } | 17565 | } |
| ... | @@ -17945,8 +17573,7 @@ pub fn vqrdmlah_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2 | ... | @@ -17945,8 +17573,7 @@ pub fn vqrdmlah_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2 |
| 17945 | pub fn vqrdmlah_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t { | 17573 | pub fn vqrdmlah_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t { |
| 17946 | static_assert_uimm_bits!(LANE, 3); | 17574 | static_assert_uimm_bits!(LANE, 3); |
| 17947 | unsafe { | 17575 | unsafe { |
| 17948 | let c: int16x4_t = | 17576 | let c: int16x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 17949 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 17950 | vqrdmlah_s16(a, b, c) | 17577 | vqrdmlah_s16(a, b, c) |
| 17951 | } | 17578 | } |
| 17952 | } | 17579 | } |
| ... | @@ -17960,7 +17587,7 @@ pub fn vqrdmlah_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x | ... | @@ -17960,7 +17587,7 @@ pub fn vqrdmlah_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x |
| 17960 | pub fn vqrdmlah_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t { | 17587 | pub fn vqrdmlah_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t { |
| 17961 | static_assert_uimm_bits!(LANE, 2); | 17588 | static_assert_uimm_bits!(LANE, 2); |
| 17962 | unsafe { | 17589 | unsafe { |
| 17963 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); | 17590 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32; 2]); |
| 17964 | vqrdmlah_s32(a, b, c) | 17591 | vqrdmlah_s32(a, b, c) |
| 17965 | } | 17592 | } |
| 17966 | } | 17593 | } |
| ... | @@ -17974,20 +17601,7 @@ pub fn vqrdmlah_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x | ... | @@ -17974,20 +17601,7 @@ pub fn vqrdmlah_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x |
| 17974 | pub fn vqrdmlahq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t { | 17601 | pub fn vqrdmlahq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t { |
| 17975 | static_assert_uimm_bits!(LANE, 2); | 17602 | static_assert_uimm_bits!(LANE, 2); |
| 17976 | unsafe { | 17603 | unsafe { |
| 17977 | let c: int16x8_t = simd_shuffle!( | 17604 | let c: int16x8_t = simd_shuffle!(c, c, [LANE as u32; 8]); |
| 17978 | c, | ||
| 17979 | c, | ||
| 17980 | [ | ||
| 17981 | LANE as u32, | ||
| 17982 | LANE as u32, | ||
| 17983 | LANE as u32, | ||
| 17984 | LANE as u32, | ||
| 17985 | LANE as u32, | ||
| 17986 | LANE as u32, | ||
| 17987 | LANE as u32, | ||
| 17988 | LANE as u32 | ||
| 17989 | ] | ||
| 17990 | ); | ||
| 17991 | vqrdmlahq_s16(a, b, c) | 17605 | vqrdmlahq_s16(a, b, c) |
| 17992 | } | 17606 | } |
| 17993 | } | 17607 | } |
| ... | @@ -18001,8 +17615,7 @@ pub fn vqrdmlahq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x | ... | @@ -18001,8 +17615,7 @@ pub fn vqrdmlahq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x |
| 18001 | pub fn vqrdmlahq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t { | 17615 | pub fn vqrdmlahq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t { |
| 18002 | static_assert_uimm_bits!(LANE, 1); | 17616 | static_assert_uimm_bits!(LANE, 1); |
| 18003 | unsafe { | 17617 | unsafe { |
| 18004 | let c: int32x4_t = | 17618 | let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18005 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18006 | vqrdmlahq_s32(a, b, c) | 17619 | vqrdmlahq_s32(a, b, c) |
| 18007 | } | 17620 | } |
| 18008 | } | 17621 | } |
| ... | @@ -18016,20 +17629,7 @@ pub fn vqrdmlahq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x | ... | @@ -18016,20 +17629,7 @@ pub fn vqrdmlahq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x |
| 18016 | pub fn vqrdmlahq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t { | 17629 | pub fn vqrdmlahq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t { |
| 18017 | static_assert_uimm_bits!(LANE, 3); | 17630 | static_assert_uimm_bits!(LANE, 3); |
| 18018 | unsafe { | 17631 | unsafe { |
| 18019 | let c: int16x8_t = simd_shuffle!( | 17632 | let c: int16x8_t = simd_shuffle!(c, c, [LANE as u32; 8]); |
| 18020 | c, | ||
| 18021 | c, | ||
| 18022 | [ | ||
| 18023 | LANE as u32, | ||
| 18024 | LANE as u32, | ||
| 18025 | LANE as u32, | ||
| 18026 | LANE as u32, | ||
| 18027 | LANE as u32, | ||
| 18028 | LANE as u32, | ||
| 18029 | LANE as u32, | ||
| 18030 | LANE as u32 | ||
| 18031 | ] | ||
| 18032 | ); | ||
| 18033 | vqrdmlahq_s16(a, b, c) | 17633 | vqrdmlahq_s16(a, b, c) |
| 18034 | } | 17634 | } |
| 18035 | } | 17635 | } |
| ... | @@ -18043,8 +17643,7 @@ pub fn vqrdmlahq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16 | ... | @@ -18043,8 +17643,7 @@ pub fn vqrdmlahq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16 |
| 18043 | pub fn vqrdmlahq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t { | 17643 | pub fn vqrdmlahq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t { |
| 18044 | static_assert_uimm_bits!(LANE, 2); | 17644 | static_assert_uimm_bits!(LANE, 2); |
| 18045 | unsafe { | 17645 | unsafe { |
| 18046 | let c: int32x4_t = | 17646 | let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18047 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18048 | vqrdmlahq_s32(a, b, c) | 17647 | vqrdmlahq_s32(a, b, c) |
| 18049 | } | 17648 | } |
| 18050 | } | 17649 | } |
| ... | @@ -18190,8 +17789,7 @@ pub fn vqrdmlahs_s32(a: i32, b: i32, c: i32) -> i32 { | ... | @@ -18190,8 +17789,7 @@ pub fn vqrdmlahs_s32(a: i32, b: i32, c: i32) -> i32 { |
| 18190 | pub fn vqrdmlsh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t { | 17789 | pub fn vqrdmlsh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4_t) -> int16x4_t { |
| 18191 | static_assert_uimm_bits!(LANE, 2); | 17790 | static_assert_uimm_bits!(LANE, 2); |
| 18192 | unsafe { | 17791 | unsafe { |
| 18193 | let c: int16x4_t = | 17792 | let c: int16x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18194 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18195 | vqrdmlsh_s16(a, b, c) | 17793 | vqrdmlsh_s16(a, b, c) |
| 18196 | } | 17794 | } |
| 18197 | } | 17795 | } |
| ... | @@ -18205,7 +17803,7 @@ pub fn vqrdmlsh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4 | ... | @@ -18205,7 +17803,7 @@ pub fn vqrdmlsh_lane_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x4 |
| 18205 | pub fn vqrdmlsh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t { | 17803 | pub fn vqrdmlsh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2_t) -> int32x2_t { |
| 18206 | static_assert_uimm_bits!(LANE, 1); | 17804 | static_assert_uimm_bits!(LANE, 1); |
| 18207 | unsafe { | 17805 | unsafe { |
| 18208 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); | 17806 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32; 2]); |
| 18209 | vqrdmlsh_s32(a, b, c) | 17807 | vqrdmlsh_s32(a, b, c) |
| 18210 | } | 17808 | } |
| 18211 | } | 17809 | } |
| ... | @@ -18219,8 +17817,7 @@ pub fn vqrdmlsh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2 | ... | @@ -18219,8 +17817,7 @@ pub fn vqrdmlsh_lane_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x2 |
| 18219 | pub fn vqrdmlsh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t { | 17817 | pub fn vqrdmlsh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x8_t) -> int16x4_t { |
| 18220 | static_assert_uimm_bits!(LANE, 3); | 17818 | static_assert_uimm_bits!(LANE, 3); |
| 18221 | unsafe { | 17819 | unsafe { |
| 18222 | let c: int16x4_t = | 17820 | let c: int16x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18223 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18224 | vqrdmlsh_s16(a, b, c) | 17821 | vqrdmlsh_s16(a, b, c) |
| 18225 | } | 17822 | } |
| 18226 | } | 17823 | } |
| ... | @@ -18234,7 +17831,7 @@ pub fn vqrdmlsh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x | ... | @@ -18234,7 +17831,7 @@ pub fn vqrdmlsh_laneq_s16<const LANE: i32>(a: int16x4_t, b: int16x4_t, c: int16x |
| 18234 | pub fn vqrdmlsh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t { | 17831 | pub fn vqrdmlsh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x4_t) -> int32x2_t { |
| 18235 | static_assert_uimm_bits!(LANE, 2); | 17832 | static_assert_uimm_bits!(LANE, 2); |
| 18236 | unsafe { | 17833 | unsafe { |
| 18237 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32, LANE as u32]); | 17834 | let c: int32x2_t = simd_shuffle!(c, c, [LANE as u32; 2]); |
| 18238 | vqrdmlsh_s32(a, b, c) | 17835 | vqrdmlsh_s32(a, b, c) |
| 18239 | } | 17836 | } |
| 18240 | } | 17837 | } |
| ... | @@ -18248,20 +17845,7 @@ pub fn vqrdmlsh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x | ... | @@ -18248,20 +17845,7 @@ pub fn vqrdmlsh_laneq_s32<const LANE: i32>(a: int32x2_t, b: int32x2_t, c: int32x |
| 18248 | pub fn vqrdmlshq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t { | 17845 | pub fn vqrdmlshq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x4_t) -> int16x8_t { |
| 18249 | static_assert_uimm_bits!(LANE, 2); | 17846 | static_assert_uimm_bits!(LANE, 2); |
| 18250 | unsafe { | 17847 | unsafe { |
| 18251 | let c: int16x8_t = simd_shuffle!( | 17848 | let c: int16x8_t = simd_shuffle!(c, c, [LANE as u32; 8]); |
| 18252 | c, | ||
| 18253 | c, | ||
| 18254 | [ | ||
| 18255 | LANE as u32, | ||
| 18256 | LANE as u32, | ||
| 18257 | LANE as u32, | ||
| 18258 | LANE as u32, | ||
| 18259 | LANE as u32, | ||
| 18260 | LANE as u32, | ||
| 18261 | LANE as u32, | ||
| 18262 | LANE as u32 | ||
| 18263 | ] | ||
| 18264 | ); | ||
| 18265 | vqrdmlshq_s16(a, b, c) | 17849 | vqrdmlshq_s16(a, b, c) |
| 18266 | } | 17850 | } |
| 18267 | } | 17851 | } |
| ... | @@ -18275,8 +17859,7 @@ pub fn vqrdmlshq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x | ... | @@ -18275,8 +17859,7 @@ pub fn vqrdmlshq_lane_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x |
| 18275 | pub fn vqrdmlshq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t { | 17859 | pub fn vqrdmlshq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x2_t) -> int32x4_t { |
| 18276 | static_assert_uimm_bits!(LANE, 1); | 17860 | static_assert_uimm_bits!(LANE, 1); |
| 18277 | unsafe { | 17861 | unsafe { |
| 18278 | let c: int32x4_t = | 17862 | let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18279 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18280 | vqrdmlshq_s32(a, b, c) | 17863 | vqrdmlshq_s32(a, b, c) |
| 18281 | } | 17864 | } |
| 18282 | } | 17865 | } |
| ... | @@ -18290,20 +17873,7 @@ pub fn vqrdmlshq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x | ... | @@ -18290,20 +17873,7 @@ pub fn vqrdmlshq_lane_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x |
| 18290 | pub fn vqrdmlshq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t { | 17873 | pub fn vqrdmlshq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16x8_t) -> int16x8_t { |
| 18291 | static_assert_uimm_bits!(LANE, 3); | 17874 | static_assert_uimm_bits!(LANE, 3); |
| 18292 | unsafe { | 17875 | unsafe { |
| 18293 | let c: int16x8_t = simd_shuffle!( | 17876 | let c: int16x8_t = simd_shuffle!(c, c, [LANE as u32; 8]); |
| 18294 | c, | ||
| 18295 | c, | ||
| 18296 | [ | ||
| 18297 | LANE as u32, | ||
| 18298 | LANE as u32, | ||
| 18299 | LANE as u32, | ||
| 18300 | LANE as u32, | ||
| 18301 | LANE as u32, | ||
| 18302 | LANE as u32, | ||
| 18303 | LANE as u32, | ||
| 18304 | LANE as u32 | ||
| 18305 | ] | ||
| 18306 | ); | ||
| 18307 | vqrdmlshq_s16(a, b, c) | 17877 | vqrdmlshq_s16(a, b, c) |
| 18308 | } | 17878 | } |
| 18309 | } | 17879 | } |
| ... | @@ -18317,8 +17887,7 @@ pub fn vqrdmlshq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16 | ... | @@ -18317,8 +17887,7 @@ pub fn vqrdmlshq_laneq_s16<const LANE: i32>(a: int16x8_t, b: int16x8_t, c: int16 |
| 18317 | pub fn vqrdmlshq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t { | 17887 | pub fn vqrdmlshq_laneq_s32<const LANE: i32>(a: int32x4_t, b: int32x4_t, c: int32x4_t) -> int32x4_t { |
| 18318 | static_assert_uimm_bits!(LANE, 2); | 17888 | static_assert_uimm_bits!(LANE, 2); |
| 18319 | unsafe { | 17889 | unsafe { |
| 18320 | let c: int32x4_t = | 17890 | let c: int32x4_t = simd_shuffle!(c, c, [LANE as u32; 4]); |
| 18321 | simd_shuffle!(c, c, [LANE as u32, LANE as u32, LANE as u32, LANE as u32]); | ||
| 18322 | vqrdmlshq_s32(a, b, c) | 17891 | vqrdmlshq_s32(a, b, c) |
| 18323 | } | 17892 | } |
| 18324 | } | 17893 | } |
| ... | @@ -25039,16 +24608,9 @@ pub unsafe fn vst1q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2_t) { | ... | @@ -25039,16 +24608,9 @@ pub unsafe fn vst1q_lane_f64<const LANE: i32>(a: *mut f64, b: float64x2_t) { |
| 25039 | #[inline(always)] | 24608 | #[inline(always)] |
| 25040 | #[target_feature(enable = "neon")] | 24609 | #[target_feature(enable = "neon")] |
| 25041 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24610 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25042 | #[cfg_attr(test, assert_instr(st1))] | 24611 | #[cfg_attr(test, assert_instr(stp))] |
| 25043 | pub unsafe fn vst2_f64(a: *mut f64, b: float64x1x2_t) { | 24612 | pub unsafe fn vst2_f64(a: *mut f64, b: float64x1x2_t) { |
| 25044 | unsafe extern "unadjusted" { | 24613 | core::ptr::write_unaligned(a.cast(), b) |
| 25045 | #[cfg_attr( | ||
| 25046 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25047 | link_name = "llvm.aarch64.neon.st2.v1f64.p0" | ||
| 25048 | )] | ||
| 25049 | fn _vst2_f64(a: float64x1_t, b: float64x1_t, ptr: *mut i8); | ||
| 25050 | } | ||
| 25051 | _vst2_f64(b.0, b.1, a as _) | ||
| 25052 | } | 24614 | } |
| 25053 | #[doc = "Store multiple 2-element structures from two registers"] | 24615 | #[doc = "Store multiple 2-element structures from two registers"] |
| 25054 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_lane_f64)"] | 24616 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_lane_f64)"] |
| ... | @@ -25125,14 +24687,7 @@ pub unsafe fn vst2_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x2_t) { | ... | @@ -25125,14 +24687,7 @@ pub unsafe fn vst2_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x2_t) { |
| 25125 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24687 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25126 | #[cfg_attr(test, assert_instr(st2))] | 24688 | #[cfg_attr(test, assert_instr(st2))] |
| 25127 | pub unsafe fn vst2q_f64(a: *mut f64, b: float64x2x2_t) { | 24689 | pub unsafe fn vst2q_f64(a: *mut f64, b: float64x2x2_t) { |
| 25128 | unsafe extern "unadjusted" { | 24690 | crate::core_arch::macros::interleaving_store!(f64, 2, 2, a, b) |
| 25129 | #[cfg_attr( | ||
| 25130 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25131 | link_name = "llvm.aarch64.neon.st2.v2f64.p0" | ||
| 25132 | )] | ||
| 25133 | fn _vst2q_f64(a: float64x2_t, b: float64x2_t, ptr: *mut i8); | ||
| 25134 | } | ||
| 25135 | _vst2q_f64(b.0, b.1, a as _) | ||
| 25136 | } | 24691 | } |
| 25137 | #[doc = "Store multiple 2-element structures from two registers"] | 24692 | #[doc = "Store multiple 2-element structures from two registers"] |
| 25138 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s64)"] | 24693 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s64)"] |
| ... | @@ -25143,14 +24698,7 @@ pub unsafe fn vst2q_f64(a: *mut f64, b: float64x2x2_t) { | ... | @@ -25143,14 +24698,7 @@ pub unsafe fn vst2q_f64(a: *mut f64, b: float64x2x2_t) { |
| 25143 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24698 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25144 | #[cfg_attr(test, assert_instr(st2))] | 24699 | #[cfg_attr(test, assert_instr(st2))] |
| 25145 | pub unsafe fn vst2q_s64(a: *mut i64, b: int64x2x2_t) { | 24700 | pub unsafe fn vst2q_s64(a: *mut i64, b: int64x2x2_t) { |
| 25146 | unsafe extern "unadjusted" { | 24701 | crate::core_arch::macros::interleaving_store!(i64, 2, 2, a, b) |
| 25147 | #[cfg_attr( | ||
| 25148 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25149 | link_name = "llvm.aarch64.neon.st2.v2i64.p0" | ||
| 25150 | )] | ||
| 25151 | fn _vst2q_s64(a: int64x2_t, b: int64x2_t, ptr: *mut i8); | ||
| 25152 | } | ||
| 25153 | _vst2q_s64(b.0, b.1, a as _) | ||
| 25154 | } | 24702 | } |
| 25155 | #[doc = "Store multiple 2-element structures from two registers"] | 24703 | #[doc = "Store multiple 2-element structures from two registers"] |
| 25156 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_lane_f64)"] | 24704 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_lane_f64)"] |
| ... | @@ -25295,14 +24843,7 @@ pub unsafe fn vst2q_u64(a: *mut u64, b: uint64x2x2_t) { | ... | @@ -25295,14 +24843,7 @@ pub unsafe fn vst2q_u64(a: *mut u64, b: uint64x2x2_t) { |
| 25295 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24843 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25296 | #[cfg_attr(test, assert_instr(nop))] | 24844 | #[cfg_attr(test, assert_instr(nop))] |
| 25297 | pub unsafe fn vst3_f64(a: *mut f64, b: float64x1x3_t) { | 24845 | pub unsafe fn vst3_f64(a: *mut f64, b: float64x1x3_t) { |
| 25298 | unsafe extern "unadjusted" { | 24846 | core::ptr::write_unaligned(a.cast(), b) |
| 25299 | #[cfg_attr( | ||
| 25300 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25301 | link_name = "llvm.aarch64.neon.st3.v1f64.p0" | ||
| 25302 | )] | ||
| 25303 | fn _vst3_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t, ptr: *mut i8); | ||
| 25304 | } | ||
| 25305 | _vst3_f64(b.0, b.1, b.2, a as _) | ||
| 25306 | } | 24847 | } |
| 25307 | #[doc = "Store multiple 3-element structures from three registers"] | 24848 | #[doc = "Store multiple 3-element structures from three registers"] |
| 25308 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_lane_f64)"] | 24849 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_lane_f64)"] |
| ... | @@ -25379,14 +24920,7 @@ pub unsafe fn vst3_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x3_t) { | ... | @@ -25379,14 +24920,7 @@ pub unsafe fn vst3_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x3_t) { |
| 25379 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24920 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25380 | #[cfg_attr(test, assert_instr(st3))] | 24921 | #[cfg_attr(test, assert_instr(st3))] |
| 25381 | pub unsafe fn vst3q_f64(a: *mut f64, b: float64x2x3_t) { | 24922 | pub unsafe fn vst3q_f64(a: *mut f64, b: float64x2x3_t) { |
| 25382 | unsafe extern "unadjusted" { | 24923 | crate::core_arch::macros::interleaving_store!(f64, 2, 3, a, b) |
| 25383 | #[cfg_attr( | ||
| 25384 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25385 | link_name = "llvm.aarch64.neon.st3.v2f64.p0" | ||
| 25386 | )] | ||
| 25387 | fn _vst3q_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t, ptr: *mut i8); | ||
| 25388 | } | ||
| 25389 | _vst3q_f64(b.0, b.1, b.2, a as _) | ||
| 25390 | } | 24924 | } |
| 25391 | #[doc = "Store multiple 3-element structures from three registers"] | 24925 | #[doc = "Store multiple 3-element structures from three registers"] |
| 25392 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s64)"] | 24926 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s64)"] |
| ... | @@ -25397,14 +24931,7 @@ pub unsafe fn vst3q_f64(a: *mut f64, b: float64x2x3_t) { | ... | @@ -25397,14 +24931,7 @@ pub unsafe fn vst3q_f64(a: *mut f64, b: float64x2x3_t) { |
| 25397 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 24931 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25398 | #[cfg_attr(test, assert_instr(st3))] | 24932 | #[cfg_attr(test, assert_instr(st3))] |
| 25399 | pub unsafe fn vst3q_s64(a: *mut i64, b: int64x2x3_t) { | 24933 | pub unsafe fn vst3q_s64(a: *mut i64, b: int64x2x3_t) { |
| 25400 | unsafe extern "unadjusted" { | 24934 | crate::core_arch::macros::interleaving_store!(i64, 2, 3, a, b) |
| 25401 | #[cfg_attr( | ||
| 25402 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25403 | link_name = "llvm.aarch64.neon.st3.v2i64.p0" | ||
| 25404 | )] | ||
| 25405 | fn _vst3q_s64(a: int64x2_t, b: int64x2_t, c: int64x2_t, ptr: *mut i8); | ||
| 25406 | } | ||
| 25407 | _vst3q_s64(b.0, b.1, b.2, a as _) | ||
| 25408 | } | 24935 | } |
| 25409 | #[doc = "Store multiple 3-element structures from three registers"] | 24936 | #[doc = "Store multiple 3-element structures from three registers"] |
| 25410 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_lane_f64)"] | 24937 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_lane_f64)"] |
| ... | @@ -25549,14 +25076,7 @@ pub unsafe fn vst3q_u64(a: *mut u64, b: uint64x2x3_t) { | ... | @@ -25549,14 +25076,7 @@ pub unsafe fn vst3q_u64(a: *mut u64, b: uint64x2x3_t) { |
| 25549 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 25076 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25550 | #[cfg_attr(test, assert_instr(nop))] | 25077 | #[cfg_attr(test, assert_instr(nop))] |
| 25551 | pub unsafe fn vst4_f64(a: *mut f64, b: float64x1x4_t) { | 25078 | pub unsafe fn vst4_f64(a: *mut f64, b: float64x1x4_t) { |
| 25552 | unsafe extern "unadjusted" { | 25079 | core::ptr::write_unaligned(a.cast(), b) |
| 25553 | #[cfg_attr( | ||
| 25554 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25555 | link_name = "llvm.aarch64.neon.st4.v1f64.p0" | ||
| 25556 | )] | ||
| 25557 | fn _vst4_f64(a: float64x1_t, b: float64x1_t, c: float64x1_t, d: float64x1_t, ptr: *mut i8); | ||
| 25558 | } | ||
| 25559 | _vst4_f64(b.0, b.1, b.2, b.3, a as _) | ||
| 25560 | } | 25080 | } |
| 25561 | #[doc = "Store multiple 4-element structures from four registers"] | 25081 | #[doc = "Store multiple 4-element structures from four registers"] |
| 25562 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_lane_f64)"] | 25082 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_lane_f64)"] |
| ... | @@ -25647,14 +25167,7 @@ pub unsafe fn vst4_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x4_t) { | ... | @@ -25647,14 +25167,7 @@ pub unsafe fn vst4_lane_u64<const LANE: i32>(a: *mut u64, b: uint64x1x4_t) { |
| 25647 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 25167 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25648 | #[cfg_attr(test, assert_instr(st4))] | 25168 | #[cfg_attr(test, assert_instr(st4))] |
| 25649 | pub unsafe fn vst4q_f64(a: *mut f64, b: float64x2x4_t) { | 25169 | pub unsafe fn vst4q_f64(a: *mut f64, b: float64x2x4_t) { |
| 25650 | unsafe extern "unadjusted" { | 25170 | crate::core_arch::macros::interleaving_store!(f64, 2, 4, a, b) |
| 25651 | #[cfg_attr( | ||
| 25652 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25653 | link_name = "llvm.aarch64.neon.st4.v2f64.p0" | ||
| 25654 | )] | ||
| 25655 | fn _vst4q_f64(a: float64x2_t, b: float64x2_t, c: float64x2_t, d: float64x2_t, ptr: *mut i8); | ||
| 25656 | } | ||
| 25657 | _vst4q_f64(b.0, b.1, b.2, b.3, a as _) | ||
| 25658 | } | 25171 | } |
| 25659 | #[doc = "Store multiple 4-element structures from four registers"] | 25172 | #[doc = "Store multiple 4-element structures from four registers"] |
| 25660 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s64)"] | 25173 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s64)"] |
| ... | @@ -25665,14 +25178,7 @@ pub unsafe fn vst4q_f64(a: *mut f64, b: float64x2x4_t) { | ... | @@ -25665,14 +25178,7 @@ pub unsafe fn vst4q_f64(a: *mut f64, b: float64x2x4_t) { |
| 25665 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 25178 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 25666 | #[cfg_attr(test, assert_instr(st4))] | 25179 | #[cfg_attr(test, assert_instr(st4))] |
| 25667 | pub unsafe fn vst4q_s64(a: *mut i64, b: int64x2x4_t) { | 25180 | pub unsafe fn vst4q_s64(a: *mut i64, b: int64x2x4_t) { |
| 25668 | unsafe extern "unadjusted" { | 25181 | crate::core_arch::macros::interleaving_store!(i64, 2, 4, a, b) |
| 25669 | #[cfg_attr( | ||
| 25670 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 25671 | link_name = "llvm.aarch64.neon.st4.v2i64.p0" | ||
| 25672 | )] | ||
| 25673 | fn _vst4q_s64(a: int64x2_t, b: int64x2_t, c: int64x2_t, d: int64x2_t, ptr: *mut i8); | ||
| 25674 | } | ||
| 25675 | _vst4q_s64(b.0, b.1, b.2, b.3, a as _) | ||
| 25676 | } | 25182 | } |
| 25677 | #[doc = "Store multiple 4-element structures from four registers"] | 25183 | #[doc = "Store multiple 4-element structures from four registers"] |
| 25678 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_lane_f64)"] | 25184 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_lane_f64)"] |
library/stdarch/crates/core_arch/src/aarch64/neon/mod.rs+8| ... | @@ -1050,6 +1050,14 @@ mod tests { | ... | @@ -1050,6 +1050,14 @@ mod tests { |
| 1050 | test_vld1q_f16_x2(f16, 16, float16x8x2_t, vst1q_f16_x2, vld1q_f16_x2); | 1050 | test_vld1q_f16_x2(f16, 16, float16x8x2_t, vst1q_f16_x2, vld1q_f16_x2); |
| 1051 | test_vld1q_f16_x3(f16, 24, float16x8x3_t, vst1q_f16_x3, vld1q_f16_x3); | 1051 | test_vld1q_f16_x3(f16, 24, float16x8x3_t, vst1q_f16_x3, vld1q_f16_x3); |
| 1052 | test_vld1q_f16_x4(f16, 32, float16x8x4_t, vst1q_f16_x4, vld1q_f16_x4); | 1052 | test_vld1q_f16_x4(f16, 32, float16x8x4_t, vst1q_f16_x4, vld1q_f16_x4); |
| 1053 | |||
| 1054 | test_vld2_f16_x2(f16, 8, float16x4x2_t, vst2_f16, vld2_f16); | ||
| 1055 | test_vld2_f16_x3(f16, 12, float16x4x3_t, vst3_f16, vld3_f16); | ||
| 1056 | test_vld2_f16_x4(f16, 16, float16x4x4_t, vst4_f16, vld4_f16); | ||
| 1057 | |||
| 1058 | test_vld2q_f16_x2(f16, 16, float16x8x2_t, vst2q_f16, vld2q_f16); | ||
| 1059 | test_vld3q_f16_x3(f16, 24, float16x8x3_t, vst3q_f16, vld3q_f16); | ||
| 1060 | test_vld4q_f16_x4(f16, 32, float16x8x4_t, vst4q_f16, vld4q_f16); | ||
| 1053 | } | 1061 | } |
| 1054 | 1062 | ||
| 1055 | macro_rules! wide_store_load_roundtrip_aes { | 1063 | macro_rules! wide_store_load_roundtrip_aes { |
library/stdarch/crates/core_arch/src/arm_shared/neon/generated.rs+66-418| ... | @@ -10149,7 +10149,7 @@ pub fn vdotq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { | ... | @@ -10149,7 +10149,7 @@ pub fn vdotq_u32(a: uint32x4_t, b: uint8x16_t, c: uint8x16_t) -> uint32x4_t { |
| 10149 | #[cfg(not(target_arch = "arm64ec"))] | 10149 | #[cfg(not(target_arch = "arm64ec"))] |
| 10150 | pub fn vdup_lane_f16<const N: i32>(a: float16x4_t) -> float16x4_t { | 10150 | pub fn vdup_lane_f16<const N: i32>(a: float16x4_t) -> float16x4_t { |
| 10151 | static_assert_uimm_bits!(N, 2); | 10151 | static_assert_uimm_bits!(N, 2); |
| 10152 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10152 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10153 | } | 10153 | } |
| 10154 | #[doc = "Set all vector lanes to the same value"] | 10154 | #[doc = "Set all vector lanes to the same value"] |
| 10155 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_f16)"] | 10155 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_f16)"] |
| ... | @@ -10174,13 +10174,7 @@ pub fn vdup_lane_f16<const N: i32>(a: float16x4_t) -> float16x4_t { | ... | @@ -10174,13 +10174,7 @@ pub fn vdup_lane_f16<const N: i32>(a: float16x4_t) -> float16x4_t { |
| 10174 | #[cfg(not(target_arch = "arm64ec"))] | 10174 | #[cfg(not(target_arch = "arm64ec"))] |
| 10175 | pub fn vdupq_lane_f16<const N: i32>(a: float16x4_t) -> float16x8_t { | 10175 | pub fn vdupq_lane_f16<const N: i32>(a: float16x4_t) -> float16x8_t { |
| 10176 | static_assert_uimm_bits!(N, 2); | 10176 | static_assert_uimm_bits!(N, 2); |
| 10177 | unsafe { | 10177 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10178 | simd_shuffle!( | ||
| 10179 | a, | ||
| 10180 | a, | ||
| 10181 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10182 | ) | ||
| 10183 | } | ||
| 10184 | } | 10178 | } |
| 10185 | #[doc = "Set all vector lanes to the same value"] | 10179 | #[doc = "Set all vector lanes to the same value"] |
| 10186 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_f32)"] | 10180 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_f32)"] |
| ... | @@ -10341,7 +10335,7 @@ pub fn vdupq_lane_u32<const N: i32>(a: uint32x2_t) -> uint32x4_t { | ... | @@ -10341,7 +10335,7 @@ pub fn vdupq_lane_u32<const N: i32>(a: uint32x2_t) -> uint32x4_t { |
| 10341 | )] | 10335 | )] |
| 10342 | pub fn vdup_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x4_t { | 10336 | pub fn vdup_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x4_t { |
| 10343 | static_assert_uimm_bits!(N, 2); | 10337 | static_assert_uimm_bits!(N, 2); |
| 10344 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10338 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10345 | } | 10339 | } |
| 10346 | #[doc = "Set all vector lanes to the same value"] | 10340 | #[doc = "Set all vector lanes to the same value"] |
| 10347 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s16)"] | 10341 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s16)"] |
| ... | @@ -10364,7 +10358,7 @@ pub fn vdup_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x4_t { | ... | @@ -10364,7 +10358,7 @@ pub fn vdup_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x4_t { |
| 10364 | )] | 10358 | )] |
| 10365 | pub fn vdup_lane_s16<const N: i32>(a: int16x4_t) -> int16x4_t { | 10359 | pub fn vdup_lane_s16<const N: i32>(a: int16x4_t) -> int16x4_t { |
| 10366 | static_assert_uimm_bits!(N, 2); | 10360 | static_assert_uimm_bits!(N, 2); |
| 10367 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10361 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10368 | } | 10362 | } |
| 10369 | #[doc = "Set all vector lanes to the same value"] | 10363 | #[doc = "Set all vector lanes to the same value"] |
| 10370 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_u16)"] | 10364 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_u16)"] |
| ... | @@ -10387,7 +10381,7 @@ pub fn vdup_lane_s16<const N: i32>(a: int16x4_t) -> int16x4_t { | ... | @@ -10387,7 +10381,7 @@ pub fn vdup_lane_s16<const N: i32>(a: int16x4_t) -> int16x4_t { |
| 10387 | )] | 10381 | )] |
| 10388 | pub fn vdup_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t { | 10382 | pub fn vdup_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t { |
| 10389 | static_assert_uimm_bits!(N, 2); | 10383 | static_assert_uimm_bits!(N, 2); |
| 10390 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10384 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10391 | } | 10385 | } |
| 10392 | #[doc = "Set all vector lanes to the same value"] | 10386 | #[doc = "Set all vector lanes to the same value"] |
| 10393 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_p16)"] | 10387 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_p16)"] |
| ... | @@ -10410,13 +10404,7 @@ pub fn vdup_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t { | ... | @@ -10410,13 +10404,7 @@ pub fn vdup_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x4_t { |
| 10410 | )] | 10404 | )] |
| 10411 | pub fn vdupq_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x8_t { | 10405 | pub fn vdupq_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x8_t { |
| 10412 | static_assert_uimm_bits!(N, 2); | 10406 | static_assert_uimm_bits!(N, 2); |
| 10413 | unsafe { | 10407 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10414 | simd_shuffle!( | ||
| 10415 | a, | ||
| 10416 | a, | ||
| 10417 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10418 | ) | ||
| 10419 | } | ||
| 10420 | } | 10408 | } |
| 10421 | #[doc = "Set all vector lanes to the same value"] | 10409 | #[doc = "Set all vector lanes to the same value"] |
| 10422 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_s16)"] | 10410 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_s16)"] |
| ... | @@ -10439,13 +10427,7 @@ pub fn vdupq_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x8_t { | ... | @@ -10439,13 +10427,7 @@ pub fn vdupq_lane_p16<const N: i32>(a: poly16x4_t) -> poly16x8_t { |
| 10439 | )] | 10427 | )] |
| 10440 | pub fn vdupq_lane_s16<const N: i32>(a: int16x4_t) -> int16x8_t { | 10428 | pub fn vdupq_lane_s16<const N: i32>(a: int16x4_t) -> int16x8_t { |
| 10441 | static_assert_uimm_bits!(N, 2); | 10429 | static_assert_uimm_bits!(N, 2); |
| 10442 | unsafe { | 10430 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10443 | simd_shuffle!( | ||
| 10444 | a, | ||
| 10445 | a, | ||
| 10446 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10447 | ) | ||
| 10448 | } | ||
| 10449 | } | 10431 | } |
| 10450 | #[doc = "Set all vector lanes to the same value"] | 10432 | #[doc = "Set all vector lanes to the same value"] |
| 10451 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_u16)"] | 10433 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_u16)"] |
| ... | @@ -10468,13 +10450,7 @@ pub fn vdupq_lane_s16<const N: i32>(a: int16x4_t) -> int16x8_t { | ... | @@ -10468,13 +10450,7 @@ pub fn vdupq_lane_s16<const N: i32>(a: int16x4_t) -> int16x8_t { |
| 10468 | )] | 10450 | )] |
| 10469 | pub fn vdupq_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x8_t { | 10451 | pub fn vdupq_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x8_t { |
| 10470 | static_assert_uimm_bits!(N, 2); | 10452 | static_assert_uimm_bits!(N, 2); |
| 10471 | unsafe { | 10453 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10472 | simd_shuffle!( | ||
| 10473 | a, | ||
| 10474 | a, | ||
| 10475 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10476 | ) | ||
| 10477 | } | ||
| 10478 | } | 10454 | } |
| 10479 | #[doc = "Set all vector lanes to the same value"] | 10455 | #[doc = "Set all vector lanes to the same value"] |
| 10480 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_p8)"] | 10456 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_p8)"] |
| ... | @@ -10497,13 +10473,7 @@ pub fn vdupq_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x8_t { | ... | @@ -10497,13 +10473,7 @@ pub fn vdupq_lane_u16<const N: i32>(a: uint16x4_t) -> uint16x8_t { |
| 10497 | )] | 10473 | )] |
| 10498 | pub fn vdup_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x8_t { | 10474 | pub fn vdup_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x8_t { |
| 10499 | static_assert_uimm_bits!(N, 3); | 10475 | static_assert_uimm_bits!(N, 3); |
| 10500 | unsafe { | 10476 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10501 | simd_shuffle!( | ||
| 10502 | a, | ||
| 10503 | a, | ||
| 10504 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10505 | ) | ||
| 10506 | } | ||
| 10507 | } | 10477 | } |
| 10508 | #[doc = "Set all vector lanes to the same value"] | 10478 | #[doc = "Set all vector lanes to the same value"] |
| 10509 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s8)"] | 10479 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s8)"] |
| ... | @@ -10526,13 +10496,7 @@ pub fn vdup_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x8_t { | ... | @@ -10526,13 +10496,7 @@ pub fn vdup_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x8_t { |
| 10526 | )] | 10496 | )] |
| 10527 | pub fn vdup_lane_s8<const N: i32>(a: int8x8_t) -> int8x8_t { | 10497 | pub fn vdup_lane_s8<const N: i32>(a: int8x8_t) -> int8x8_t { |
| 10528 | static_assert_uimm_bits!(N, 3); | 10498 | static_assert_uimm_bits!(N, 3); |
| 10529 | unsafe { | 10499 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10530 | simd_shuffle!( | ||
| 10531 | a, | ||
| 10532 | a, | ||
| 10533 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10534 | ) | ||
| 10535 | } | ||
| 10536 | } | 10500 | } |
| 10537 | #[doc = "Set all vector lanes to the same value"] | 10501 | #[doc = "Set all vector lanes to the same value"] |
| 10538 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_u8)"] | 10502 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_u8)"] |
| ... | @@ -10555,13 +10519,7 @@ pub fn vdup_lane_s8<const N: i32>(a: int8x8_t) -> int8x8_t { | ... | @@ -10555,13 +10519,7 @@ pub fn vdup_lane_s8<const N: i32>(a: int8x8_t) -> int8x8_t { |
| 10555 | )] | 10519 | )] |
| 10556 | pub fn vdup_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t { | 10520 | pub fn vdup_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t { |
| 10557 | static_assert_uimm_bits!(N, 3); | 10521 | static_assert_uimm_bits!(N, 3); |
| 10558 | unsafe { | 10522 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10559 | simd_shuffle!( | ||
| 10560 | a, | ||
| 10561 | a, | ||
| 10562 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10563 | ) | ||
| 10564 | } | ||
| 10565 | } | 10523 | } |
| 10566 | #[doc = "Set all vector lanes to the same value"] | 10524 | #[doc = "Set all vector lanes to the same value"] |
| 10567 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_p8)"] | 10525 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_p8)"] |
| ... | @@ -10584,16 +10542,7 @@ pub fn vdup_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t { | ... | @@ -10584,16 +10542,7 @@ pub fn vdup_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x8_t { |
| 10584 | )] | 10542 | )] |
| 10585 | pub fn vdupq_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x16_t { | 10543 | pub fn vdupq_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x16_t { |
| 10586 | static_assert_uimm_bits!(N, 3); | 10544 | static_assert_uimm_bits!(N, 3); |
| 10587 | unsafe { | 10545 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 10588 | simd_shuffle!( | ||
| 10589 | a, | ||
| 10590 | a, | ||
| 10591 | [ | ||
| 10592 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 10593 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 10594 | ] | ||
| 10595 | ) | ||
| 10596 | } | ||
| 10597 | } | 10546 | } |
| 10598 | #[doc = "Set all vector lanes to the same value"] | 10547 | #[doc = "Set all vector lanes to the same value"] |
| 10599 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_s8)"] | 10548 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_s8)"] |
| ... | @@ -10616,16 +10565,7 @@ pub fn vdupq_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x16_t { | ... | @@ -10616,16 +10565,7 @@ pub fn vdupq_lane_p8<const N: i32>(a: poly8x8_t) -> poly8x16_t { |
| 10616 | )] | 10565 | )] |
| 10617 | pub fn vdupq_lane_s8<const N: i32>(a: int8x8_t) -> int8x16_t { | 10566 | pub fn vdupq_lane_s8<const N: i32>(a: int8x8_t) -> int8x16_t { |
| 10618 | static_assert_uimm_bits!(N, 3); | 10567 | static_assert_uimm_bits!(N, 3); |
| 10619 | unsafe { | 10568 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 10620 | simd_shuffle!( | ||
| 10621 | a, | ||
| 10622 | a, | ||
| 10623 | [ | ||
| 10624 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 10625 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 10626 | ] | ||
| 10627 | ) | ||
| 10628 | } | ||
| 10629 | } | 10569 | } |
| 10630 | #[doc = "Set all vector lanes to the same value"] | 10570 | #[doc = "Set all vector lanes to the same value"] |
| 10631 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_u8)"] | 10571 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_lane_u8)"] |
| ... | @@ -10648,16 +10588,7 @@ pub fn vdupq_lane_s8<const N: i32>(a: int8x8_t) -> int8x16_t { | ... | @@ -10648,16 +10588,7 @@ pub fn vdupq_lane_s8<const N: i32>(a: int8x8_t) -> int8x16_t { |
| 10648 | )] | 10588 | )] |
| 10649 | pub fn vdupq_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x16_t { | 10589 | pub fn vdupq_lane_u8<const N: i32>(a: uint8x8_t) -> uint8x16_t { |
| 10650 | static_assert_uimm_bits!(N, 3); | 10590 | static_assert_uimm_bits!(N, 3); |
| 10651 | unsafe { | 10591 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 10652 | simd_shuffle!( | ||
| 10653 | a, | ||
| 10654 | a, | ||
| 10655 | [ | ||
| 10656 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 10657 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 10658 | ] | ||
| 10659 | ) | ||
| 10660 | } | ||
| 10661 | } | 10592 | } |
| 10662 | #[doc = "Set all vector lanes to the same value"] | 10593 | #[doc = "Set all vector lanes to the same value"] |
| 10663 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s64)"] | 10594 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_lane_s64)"] |
| ... | @@ -10728,7 +10659,7 @@ pub fn vdup_lane_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t { | ... | @@ -10728,7 +10659,7 @@ pub fn vdup_lane_u64<const N: i32>(a: uint64x1_t) -> uint64x1_t { |
| 10728 | #[cfg(not(target_arch = "arm64ec"))] | 10659 | #[cfg(not(target_arch = "arm64ec"))] |
| 10729 | pub fn vdup_laneq_f16<const N: i32>(a: float16x8_t) -> float16x4_t { | 10660 | pub fn vdup_laneq_f16<const N: i32>(a: float16x8_t) -> float16x4_t { |
| 10730 | static_assert_uimm_bits!(N, 3); | 10661 | static_assert_uimm_bits!(N, 3); |
| 10731 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10662 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10732 | } | 10663 | } |
| 10733 | #[doc = "Set all vector lanes to the same value"] | 10664 | #[doc = "Set all vector lanes to the same value"] |
| 10734 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_f16)"] | 10665 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_f16)"] |
| ... | @@ -10753,13 +10684,7 @@ pub fn vdup_laneq_f16<const N: i32>(a: float16x8_t) -> float16x4_t { | ... | @@ -10753,13 +10684,7 @@ pub fn vdup_laneq_f16<const N: i32>(a: float16x8_t) -> float16x4_t { |
| 10753 | #[cfg(not(target_arch = "arm64ec"))] | 10684 | #[cfg(not(target_arch = "arm64ec"))] |
| 10754 | pub fn vdupq_laneq_f16<const N: i32>(a: float16x8_t) -> float16x8_t { | 10685 | pub fn vdupq_laneq_f16<const N: i32>(a: float16x8_t) -> float16x8_t { |
| 10755 | static_assert_uimm_bits!(N, 3); | 10686 | static_assert_uimm_bits!(N, 3); |
| 10756 | unsafe { | 10687 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10757 | simd_shuffle!( | ||
| 10758 | a, | ||
| 10759 | a, | ||
| 10760 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10761 | ) | ||
| 10762 | } | ||
| 10763 | } | 10688 | } |
| 10764 | #[doc = "Set all vector lanes to the same value"] | 10689 | #[doc = "Set all vector lanes to the same value"] |
| 10765 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_f32)"] | 10690 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_f32)"] |
| ... | @@ -10920,7 +10845,7 @@ pub fn vdupq_laneq_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t { | ... | @@ -10920,7 +10845,7 @@ pub fn vdupq_laneq_u32<const N: i32>(a: uint32x4_t) -> uint32x4_t { |
| 10920 | )] | 10845 | )] |
| 10921 | pub fn vdup_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x4_t { | 10846 | pub fn vdup_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x4_t { |
| 10922 | static_assert_uimm_bits!(N, 3); | 10847 | static_assert_uimm_bits!(N, 3); |
| 10923 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10848 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10924 | } | 10849 | } |
| 10925 | #[doc = "Set all vector lanes to the same value"] | 10850 | #[doc = "Set all vector lanes to the same value"] |
| 10926 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s16)"] | 10851 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s16)"] |
| ... | @@ -10943,7 +10868,7 @@ pub fn vdup_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x4_t { | ... | @@ -10943,7 +10868,7 @@ pub fn vdup_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x4_t { |
| 10943 | )] | 10868 | )] |
| 10944 | pub fn vdup_laneq_s16<const N: i32>(a: int16x8_t) -> int16x4_t { | 10869 | pub fn vdup_laneq_s16<const N: i32>(a: int16x8_t) -> int16x4_t { |
| 10945 | static_assert_uimm_bits!(N, 3); | 10870 | static_assert_uimm_bits!(N, 3); |
| 10946 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10871 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10947 | } | 10872 | } |
| 10948 | #[doc = "Set all vector lanes to the same value"] | 10873 | #[doc = "Set all vector lanes to the same value"] |
| 10949 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_u16)"] | 10874 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_u16)"] |
| ... | @@ -10966,7 +10891,7 @@ pub fn vdup_laneq_s16<const N: i32>(a: int16x8_t) -> int16x4_t { | ... | @@ -10966,7 +10891,7 @@ pub fn vdup_laneq_s16<const N: i32>(a: int16x8_t) -> int16x4_t { |
| 10966 | )] | 10891 | )] |
| 10967 | pub fn vdup_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x4_t { | 10892 | pub fn vdup_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x4_t { |
| 10968 | static_assert_uimm_bits!(N, 3); | 10893 | static_assert_uimm_bits!(N, 3); |
| 10969 | unsafe { simd_shuffle!(a, a, [N as u32, N as u32, N as u32, N as u32]) } | 10894 | unsafe { simd_shuffle!(a, a, [N as u32; 4]) } |
| 10970 | } | 10895 | } |
| 10971 | #[doc = "Set all vector lanes to the same value"] | 10896 | #[doc = "Set all vector lanes to the same value"] |
| 10972 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_p16)"] | 10897 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_p16)"] |
| ... | @@ -10989,13 +10914,7 @@ pub fn vdup_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x4_t { | ... | @@ -10989,13 +10914,7 @@ pub fn vdup_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x4_t { |
| 10989 | )] | 10914 | )] |
| 10990 | pub fn vdupq_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x8_t { | 10915 | pub fn vdupq_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x8_t { |
| 10991 | static_assert_uimm_bits!(N, 3); | 10916 | static_assert_uimm_bits!(N, 3); |
| 10992 | unsafe { | 10917 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 10993 | simd_shuffle!( | ||
| 10994 | a, | ||
| 10995 | a, | ||
| 10996 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 10997 | ) | ||
| 10998 | } | ||
| 10999 | } | 10918 | } |
| 11000 | #[doc = "Set all vector lanes to the same value"] | 10919 | #[doc = "Set all vector lanes to the same value"] |
| 11001 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_s16)"] | 10920 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_s16)"] |
| ... | @@ -11018,13 +10937,7 @@ pub fn vdupq_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x8_t { | ... | @@ -11018,13 +10937,7 @@ pub fn vdupq_laneq_p16<const N: i32>(a: poly16x8_t) -> poly16x8_t { |
| 11018 | )] | 10937 | )] |
| 11019 | pub fn vdupq_laneq_s16<const N: i32>(a: int16x8_t) -> int16x8_t { | 10938 | pub fn vdupq_laneq_s16<const N: i32>(a: int16x8_t) -> int16x8_t { |
| 11020 | static_assert_uimm_bits!(N, 3); | 10939 | static_assert_uimm_bits!(N, 3); |
| 11021 | unsafe { | 10940 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 11022 | simd_shuffle!( | ||
| 11023 | a, | ||
| 11024 | a, | ||
| 11025 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 11026 | ) | ||
| 11027 | } | ||
| 11028 | } | 10941 | } |
| 11029 | #[doc = "Set all vector lanes to the same value"] | 10942 | #[doc = "Set all vector lanes to the same value"] |
| 11030 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_u16)"] | 10943 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_u16)"] |
| ... | @@ -11047,13 +10960,7 @@ pub fn vdupq_laneq_s16<const N: i32>(a: int16x8_t) -> int16x8_t { | ... | @@ -11047,13 +10960,7 @@ pub fn vdupq_laneq_s16<const N: i32>(a: int16x8_t) -> int16x8_t { |
| 11047 | )] | 10960 | )] |
| 11048 | pub fn vdupq_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t { | 10961 | pub fn vdupq_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t { |
| 11049 | static_assert_uimm_bits!(N, 3); | 10962 | static_assert_uimm_bits!(N, 3); |
| 11050 | unsafe { | 10963 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 11051 | simd_shuffle!( | ||
| 11052 | a, | ||
| 11053 | a, | ||
| 11054 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 11055 | ) | ||
| 11056 | } | ||
| 11057 | } | 10964 | } |
| 11058 | #[doc = "Set all vector lanes to the same value"] | 10965 | #[doc = "Set all vector lanes to the same value"] |
| 11059 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_p8)"] | 10966 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_p8)"] |
| ... | @@ -11076,13 +10983,7 @@ pub fn vdupq_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t { | ... | @@ -11076,13 +10983,7 @@ pub fn vdupq_laneq_u16<const N: i32>(a: uint16x8_t) -> uint16x8_t { |
| 11076 | )] | 10983 | )] |
| 11077 | pub fn vdup_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x8_t { | 10984 | pub fn vdup_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x8_t { |
| 11078 | static_assert_uimm_bits!(N, 4); | 10985 | static_assert_uimm_bits!(N, 4); |
| 11079 | unsafe { | 10986 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 11080 | simd_shuffle!( | ||
| 11081 | a, | ||
| 11082 | a, | ||
| 11083 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 11084 | ) | ||
| 11085 | } | ||
| 11086 | } | 10987 | } |
| 11087 | #[doc = "Set all vector lanes to the same value"] | 10988 | #[doc = "Set all vector lanes to the same value"] |
| 11088 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s8)"] | 10989 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s8)"] |
| ... | @@ -11105,13 +11006,7 @@ pub fn vdup_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x8_t { | ... | @@ -11105,13 +11006,7 @@ pub fn vdup_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x8_t { |
| 11105 | )] | 11006 | )] |
| 11106 | pub fn vdup_laneq_s8<const N: i32>(a: int8x16_t) -> int8x8_t { | 11007 | pub fn vdup_laneq_s8<const N: i32>(a: int8x16_t) -> int8x8_t { |
| 11107 | static_assert_uimm_bits!(N, 4); | 11008 | static_assert_uimm_bits!(N, 4); |
| 11108 | unsafe { | 11009 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 11109 | simd_shuffle!( | ||
| 11110 | a, | ||
| 11111 | a, | ||
| 11112 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 11113 | ) | ||
| 11114 | } | ||
| 11115 | } | 11010 | } |
| 11116 | #[doc = "Set all vector lanes to the same value"] | 11011 | #[doc = "Set all vector lanes to the same value"] |
| 11117 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_u8)"] | 11012 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_u8)"] |
| ... | @@ -11134,13 +11029,7 @@ pub fn vdup_laneq_s8<const N: i32>(a: int8x16_t) -> int8x8_t { | ... | @@ -11134,13 +11029,7 @@ pub fn vdup_laneq_s8<const N: i32>(a: int8x16_t) -> int8x8_t { |
| 11134 | )] | 11029 | )] |
| 11135 | pub fn vdup_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x8_t { | 11030 | pub fn vdup_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x8_t { |
| 11136 | static_assert_uimm_bits!(N, 4); | 11031 | static_assert_uimm_bits!(N, 4); |
| 11137 | unsafe { | 11032 | unsafe { simd_shuffle!(a, a, [N as u32; 8]) } |
| 11138 | simd_shuffle!( | ||
| 11139 | a, | ||
| 11140 | a, | ||
| 11141 | [N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32] | ||
| 11142 | ) | ||
| 11143 | } | ||
| 11144 | } | 11033 | } |
| 11145 | #[doc = "Set all vector lanes to the same value"] | 11034 | #[doc = "Set all vector lanes to the same value"] |
| 11146 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_p8)"] | 11035 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_p8)"] |
| ... | @@ -11163,16 +11052,7 @@ pub fn vdup_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x8_t { | ... | @@ -11163,16 +11052,7 @@ pub fn vdup_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x8_t { |
| 11163 | )] | 11052 | )] |
| 11164 | pub fn vdupq_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x16_t { | 11053 | pub fn vdupq_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x16_t { |
| 11165 | static_assert_uimm_bits!(N, 4); | 11054 | static_assert_uimm_bits!(N, 4); |
| 11166 | unsafe { | 11055 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 11167 | simd_shuffle!( | ||
| 11168 | a, | ||
| 11169 | a, | ||
| 11170 | [ | ||
| 11171 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 11172 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 11173 | ] | ||
| 11174 | ) | ||
| 11175 | } | ||
| 11176 | } | 11056 | } |
| 11177 | #[doc = "Set all vector lanes to the same value"] | 11057 | #[doc = "Set all vector lanes to the same value"] |
| 11178 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_s8)"] | 11058 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_s8)"] |
| ... | @@ -11195,16 +11075,7 @@ pub fn vdupq_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x16_t { | ... | @@ -11195,16 +11075,7 @@ pub fn vdupq_laneq_p8<const N: i32>(a: poly8x16_t) -> poly8x16_t { |
| 11195 | )] | 11075 | )] |
| 11196 | pub fn vdupq_laneq_s8<const N: i32>(a: int8x16_t) -> int8x16_t { | 11076 | pub fn vdupq_laneq_s8<const N: i32>(a: int8x16_t) -> int8x16_t { |
| 11197 | static_assert_uimm_bits!(N, 4); | 11077 | static_assert_uimm_bits!(N, 4); |
| 11198 | unsafe { | 11078 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 11199 | simd_shuffle!( | ||
| 11200 | a, | ||
| 11201 | a, | ||
| 11202 | [ | ||
| 11203 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 11204 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 11205 | ] | ||
| 11206 | ) | ||
| 11207 | } | ||
| 11208 | } | 11079 | } |
| 11209 | #[doc = "Set all vector lanes to the same value"] | 11080 | #[doc = "Set all vector lanes to the same value"] |
| 11210 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_u8)"] | 11081 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdupq_laneq_u8)"] |
| ... | @@ -11227,16 +11098,7 @@ pub fn vdupq_laneq_s8<const N: i32>(a: int8x16_t) -> int8x16_t { | ... | @@ -11227,16 +11098,7 @@ pub fn vdupq_laneq_s8<const N: i32>(a: int8x16_t) -> int8x16_t { |
| 11227 | )] | 11098 | )] |
| 11228 | pub fn vdupq_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t { | 11099 | pub fn vdupq_laneq_u8<const N: i32>(a: uint8x16_t) -> uint8x16_t { |
| 11229 | static_assert_uimm_bits!(N, 4); | 11100 | static_assert_uimm_bits!(N, 4); |
| 11230 | unsafe { | 11101 | unsafe { simd_shuffle!(a, a, [N as u32; 16]) } |
| 11231 | simd_shuffle!( | ||
| 11232 | a, | ||
| 11233 | a, | ||
| 11234 | [ | ||
| 11235 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, | ||
| 11236 | N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32 | ||
| 11237 | ] | ||
| 11238 | ) | ||
| 11239 | } | ||
| 11240 | } | 11102 | } |
| 11241 | #[doc = "Set all vector lanes to the same value"] | 11103 | #[doc = "Set all vector lanes to the same value"] |
| 11242 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s64)"] | 11104 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdup_laneq_s64)"] |
| ... | @@ -35894,7 +35756,7 @@ pub fn vqdmulhq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { | ... | @@ -35894,7 +35756,7 @@ pub fn vqdmulhq_s32(a: int32x4_t, b: int32x4_t) -> int32x4_t { |
| 35894 | pub fn vqdmull_lane_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t { | 35756 | pub fn vqdmull_lane_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t { |
| 35895 | static_assert_uimm_bits!(N, 2); | 35757 | static_assert_uimm_bits!(N, 2); |
| 35896 | unsafe { | 35758 | unsafe { |
| 35897 | let b: int16x4_t = simd_shuffle!(b, b, [N as u32, N as u32, N as u32, N as u32]); | 35759 | let b: int16x4_t = simd_shuffle!(b, b, [N as u32; 4]); |
| 35898 | vqdmull_s16(a, b) | 35760 | vqdmull_s16(a, b) |
| 35899 | } | 35761 | } |
| 35900 | } | 35762 | } |
| ... | @@ -35920,7 +35782,7 @@ pub fn vqdmull_lane_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t { | ... | @@ -35920,7 +35782,7 @@ pub fn vqdmull_lane_s16<const N: i32>(a: int16x4_t, b: int16x4_t) -> int32x4_t { |
| 35920 | pub fn vqdmull_lane_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int64x2_t { | 35782 | pub fn vqdmull_lane_s32<const N: i32>(a: int32x2_t, b: int32x2_t) -> int64x2_t { |
| 35921 | static_assert_uimm_bits!(N, 1); | 35783 | static_assert_uimm_bits!(N, 1); |
| 35922 | unsafe { | 35784 | unsafe { |
| 35923 | let b: int32x2_t = simd_shuffle!(b, b, [N as u32, N as u32]); | 35785 | let b: int32x2_t = simd_shuffle!(b, b, [N as u32; 2]); |
| 35924 | vqdmull_s32(a, b) | 35786 | vqdmull_s32(a, b) |
| 35925 | } | 35787 | } |
| 35926 | } | 35788 | } |
| ... | @@ -37480,17 +37342,7 @@ pub fn vqrshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t { | ... | @@ -37480,17 +37342,7 @@ pub fn vqrshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t { |
| 37480 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v8i8")] | 37342 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v8i8")] |
| 37481 | fn _vqrshrn_n_u16(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t; | 37343 | fn _vqrshrn_n_u16(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t; |
| 37482 | } | 37344 | } |
| 37483 | unsafe { | 37345 | unsafe { _vqrshrn_n_u16(a, const { uint16x8_t([-N as u16; 8]) }) } |
| 37484 | _vqrshrn_n_u16( | ||
| 37485 | a, | ||
| 37486 | const { | ||
| 37487 | uint16x8_t([ | ||
| 37488 | -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, | ||
| 37489 | -N as u16, | ||
| 37490 | ]) | ||
| 37491 | }, | ||
| 37492 | ) | ||
| 37493 | } | ||
| 37494 | } | 37346 | } |
| 37495 | #[doc = "Unsigned signed saturating rounded shift right narrow"] | 37347 | #[doc = "Unsigned signed saturating rounded shift right narrow"] |
| 37496 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u32)"] | 37348 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u32)"] |
| ... | @@ -37506,12 +37358,7 @@ pub fn vqrshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t { | ... | @@ -37506,12 +37358,7 @@ pub fn vqrshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t { |
| 37506 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v4i16")] | 37358 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v4i16")] |
| 37507 | fn _vqrshrn_n_u32(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t; | 37359 | fn _vqrshrn_n_u32(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t; |
| 37508 | } | 37360 | } |
| 37509 | unsafe { | 37361 | unsafe { _vqrshrn_n_u32(a, const { uint32x4_t([-N as u32; 4]) }) } |
| 37510 | _vqrshrn_n_u32( | ||
| 37511 | a, | ||
| 37512 | const { uint32x4_t([-N as u32, -N as u32, -N as u32, -N as u32]) }, | ||
| 37513 | ) | ||
| 37514 | } | ||
| 37515 | } | 37362 | } |
| 37516 | #[doc = "Unsigned signed saturating rounded shift right narrow"] | 37363 | #[doc = "Unsigned signed saturating rounded shift right narrow"] |
| 37517 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u64)"] | 37364 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u64)"] |
| ... | @@ -37527,7 +37374,7 @@ pub fn vqrshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t { | ... | @@ -37527,7 +37374,7 @@ pub fn vqrshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t { |
| 37527 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v2i32")] | 37374 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqrshiftnu.v2i32")] |
| 37528 | fn _vqrshrn_n_u64(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t; | 37375 | fn _vqrshrn_n_u64(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t; |
| 37529 | } | 37376 | } |
| 37530 | unsafe { _vqrshrn_n_u64(a, const { uint64x2_t([-N as u64, -N as u64]) }) } | 37377 | unsafe { _vqrshrn_n_u64(a, const { uint64x2_t([-N as u64; 2]) }) } |
| 37531 | } | 37378 | } |
| 37532 | #[doc = "Unsigned signed saturating rounded shift right narrow"] | 37379 | #[doc = "Unsigned signed saturating rounded shift right narrow"] |
| 37533 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u16)"] | 37380 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqrshrn_n_u16)"] |
| ... | @@ -38922,17 +38769,7 @@ pub fn vqshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t { | ... | @@ -38922,17 +38769,7 @@ pub fn vqshrn_n_u16<const N: i32>(a: uint16x8_t) -> uint8x8_t { |
| 38922 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v8i8")] | 38769 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v8i8")] |
| 38923 | fn _vqshrn_n_u16(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t; | 38770 | fn _vqshrn_n_u16(a: uint16x8_t, n: uint16x8_t) -> uint8x8_t; |
| 38924 | } | 38771 | } |
| 38925 | unsafe { | 38772 | unsafe { _vqshrn_n_u16(a, const { uint16x8_t([-N as u16; 8]) }) } |
| 38926 | _vqshrn_n_u16( | ||
| 38927 | a, | ||
| 38928 | const { | ||
| 38929 | uint16x8_t([ | ||
| 38930 | -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, | ||
| 38931 | -N as u16, | ||
| 38932 | ]) | ||
| 38933 | }, | ||
| 38934 | ) | ||
| 38935 | } | ||
| 38936 | } | 38773 | } |
| 38937 | #[doc = "Unsigned saturating shift right narrow"] | 38774 | #[doc = "Unsigned saturating shift right narrow"] |
| 38938 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u32)"] | 38775 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u32)"] |
| ... | @@ -38948,12 +38785,7 @@ pub fn vqshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t { | ... | @@ -38948,12 +38785,7 @@ pub fn vqshrn_n_u32<const N: i32>(a: uint32x4_t) -> uint16x4_t { |
| 38948 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v4i16")] | 38785 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v4i16")] |
| 38949 | fn _vqshrn_n_u32(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t; | 38786 | fn _vqshrn_n_u32(a: uint32x4_t, n: uint32x4_t) -> uint16x4_t; |
| 38950 | } | 38787 | } |
| 38951 | unsafe { | 38788 | unsafe { _vqshrn_n_u32(a, const { uint32x4_t([-N as u32; 4]) }) } |
| 38952 | _vqshrn_n_u32( | ||
| 38953 | a, | ||
| 38954 | const { uint32x4_t([-N as u32, -N as u32, -N as u32, -N as u32]) }, | ||
| 38955 | ) | ||
| 38956 | } | ||
| 38957 | } | 38789 | } |
| 38958 | #[doc = "Unsigned saturating shift right narrow"] | 38790 | #[doc = "Unsigned saturating shift right narrow"] |
| 38959 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u64)"] | 38791 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u64)"] |
| ... | @@ -38969,7 +38801,7 @@ pub fn vqshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t { | ... | @@ -38969,7 +38801,7 @@ pub fn vqshrn_n_u64<const N: i32>(a: uint64x2_t) -> uint32x2_t { |
| 38969 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v2i32")] | 38801 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vqshiftnu.v2i32")] |
| 38970 | fn _vqshrn_n_u64(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t; | 38802 | fn _vqshrn_n_u64(a: uint64x2_t, n: uint64x2_t) -> uint32x2_t; |
| 38971 | } | 38803 | } |
| 38972 | unsafe { _vqshrn_n_u64(a, const { uint64x2_t([-N as u64, -N as u64]) }) } | 38804 | unsafe { _vqshrn_n_u64(a, const { uint64x2_t([-N as u64; 2]) }) } |
| 38973 | } | 38805 | } |
| 38974 | #[doc = "Unsigned saturating shift right narrow"] | 38806 | #[doc = "Unsigned saturating shift right narrow"] |
| 38975 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u16)"] | 38807 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vqshrn_n_u16)"] |
| ... | @@ -66001,14 +65833,7 @@ pub unsafe fn vst2q_f16(a: *mut f16, b: float16x8x2_t) { | ... | @@ -66001,14 +65833,7 @@ pub unsafe fn vst2q_f16(a: *mut f16, b: float16x8x2_t) { |
| 66001 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65833 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66002 | #[cfg_attr(test, assert_instr(st2))] | 65834 | #[cfg_attr(test, assert_instr(st2))] |
| 66003 | pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) { | 65835 | pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) { |
| 66004 | unsafe extern "unadjusted" { | 65836 | crate::core_arch::macros::interleaving_store!(f32, 2, 2, a, b) |
| 66005 | #[cfg_attr( | ||
| 66006 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66007 | link_name = "llvm.aarch64.neon.st2.v2f32.p0" | ||
| 66008 | )] | ||
| 66009 | fn _vst2_f32(a: float32x2_t, b: float32x2_t, ptr: *mut i8); | ||
| 66010 | } | ||
| 66011 | _vst2_f32(b.0, b.1, a as _) | ||
| 66012 | } | 65837 | } |
| 66013 | #[doc = "Store multiple 2-element structures from two registers"] | 65838 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66014 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_f32)"] | 65839 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_f32)"] |
| ... | @@ -66020,14 +65845,7 @@ pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) { | ... | @@ -66020,14 +65845,7 @@ pub unsafe fn vst2_f32(a: *mut f32, b: float32x2x2_t) { |
| 66020 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65845 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66021 | #[cfg_attr(test, assert_instr(st2))] | 65846 | #[cfg_attr(test, assert_instr(st2))] |
| 66022 | pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) { | 65847 | pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) { |
| 66023 | unsafe extern "unadjusted" { | 65848 | crate::core_arch::macros::interleaving_store!(f32, 4, 2, a, b) |
| 66024 | #[cfg_attr( | ||
| 66025 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66026 | link_name = "llvm.aarch64.neon.st2.v4f32.p0" | ||
| 66027 | )] | ||
| 66028 | fn _vst2q_f32(a: float32x4_t, b: float32x4_t, ptr: *mut i8); | ||
| 66029 | } | ||
| 66030 | _vst2q_f32(b.0, b.1, a as _) | ||
| 66031 | } | 65849 | } |
| 66032 | #[doc = "Store multiple 2-element structures from two registers"] | 65850 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66033 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s8)"] | 65851 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s8)"] |
| ... | @@ -66039,14 +65857,7 @@ pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) { | ... | @@ -66039,14 +65857,7 @@ pub unsafe fn vst2q_f32(a: *mut f32, b: float32x4x2_t) { |
| 66039 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65857 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66040 | #[cfg_attr(test, assert_instr(st2))] | 65858 | #[cfg_attr(test, assert_instr(st2))] |
| 66041 | pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) { | 65859 | pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) { |
| 66042 | unsafe extern "unadjusted" { | 65860 | crate::core_arch::macros::interleaving_store!(i8, 8, 2, a, b) |
| 66043 | #[cfg_attr( | ||
| 66044 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66045 | link_name = "llvm.aarch64.neon.st2.v8i8.p0" | ||
| 66046 | )] | ||
| 66047 | fn _vst2_s8(a: int8x8_t, b: int8x8_t, ptr: *mut i8); | ||
| 66048 | } | ||
| 66049 | _vst2_s8(b.0, b.1, a as _) | ||
| 66050 | } | 65861 | } |
| 66051 | #[doc = "Store multiple 2-element structures from two registers"] | 65862 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66052 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s8)"] | 65863 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s8)"] |
| ... | @@ -66058,14 +65869,7 @@ pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) { | ... | @@ -66058,14 +65869,7 @@ pub unsafe fn vst2_s8(a: *mut i8, b: int8x8x2_t) { |
| 66058 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65869 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66059 | #[cfg_attr(test, assert_instr(st2))] | 65870 | #[cfg_attr(test, assert_instr(st2))] |
| 66060 | pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) { | 65871 | pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) { |
| 66061 | unsafe extern "unadjusted" { | 65872 | crate::core_arch::macros::interleaving_store!(i8, 16, 2, a, b) |
| 66062 | #[cfg_attr( | ||
| 66063 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66064 | link_name = "llvm.aarch64.neon.st2.v16i8.p0" | ||
| 66065 | )] | ||
| 66066 | fn _vst2q_s8(a: int8x16_t, b: int8x16_t, ptr: *mut i8); | ||
| 66067 | } | ||
| 66068 | _vst2q_s8(b.0, b.1, a as _) | ||
| 66069 | } | 65873 | } |
| 66070 | #[doc = "Store multiple 2-element structures from two registers"] | 65874 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66071 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s16)"] | 65875 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s16)"] |
| ... | @@ -66077,14 +65881,7 @@ pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) { | ... | @@ -66077,14 +65881,7 @@ pub unsafe fn vst2q_s8(a: *mut i8, b: int8x16x2_t) { |
| 66077 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65881 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66078 | #[cfg_attr(test, assert_instr(st2))] | 65882 | #[cfg_attr(test, assert_instr(st2))] |
| 66079 | pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) { | 65883 | pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) { |
| 66080 | unsafe extern "unadjusted" { | 65884 | crate::core_arch::macros::interleaving_store!(i16, 4, 2, a, b) |
| 66081 | #[cfg_attr( | ||
| 66082 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66083 | link_name = "llvm.aarch64.neon.st2.v4i16.p0" | ||
| 66084 | )] | ||
| 66085 | fn _vst2_s16(a: int16x4_t, b: int16x4_t, ptr: *mut i8); | ||
| 66086 | } | ||
| 66087 | _vst2_s16(b.0, b.1, a as _) | ||
| 66088 | } | 65885 | } |
| 66089 | #[doc = "Store multiple 2-element structures from two registers"] | 65886 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66090 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s16)"] | 65887 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s16)"] |
| ... | @@ -66096,14 +65893,7 @@ pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) { | ... | @@ -66096,14 +65893,7 @@ pub unsafe fn vst2_s16(a: *mut i16, b: int16x4x2_t) { |
| 66096 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65893 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66097 | #[cfg_attr(test, assert_instr(st2))] | 65894 | #[cfg_attr(test, assert_instr(st2))] |
| 66098 | pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) { | 65895 | pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) { |
| 66099 | unsafe extern "unadjusted" { | 65896 | crate::core_arch::macros::interleaving_store!(i16, 8, 2, a, b) |
| 66100 | #[cfg_attr( | ||
| 66101 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66102 | link_name = "llvm.aarch64.neon.st2.v8i16.p0" | ||
| 66103 | )] | ||
| 66104 | fn _vst2q_s16(a: int16x8_t, b: int16x8_t, ptr: *mut i8); | ||
| 66105 | } | ||
| 66106 | _vst2q_s16(b.0, b.1, a as _) | ||
| 66107 | } | 65897 | } |
| 66108 | #[doc = "Store multiple 2-element structures from two registers"] | 65898 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66109 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s32)"] | 65899 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s32)"] |
| ... | @@ -66115,14 +65905,7 @@ pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) { | ... | @@ -66115,14 +65905,7 @@ pub unsafe fn vst2q_s16(a: *mut i16, b: int16x8x2_t) { |
| 66115 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65905 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66116 | #[cfg_attr(test, assert_instr(st2))] | 65906 | #[cfg_attr(test, assert_instr(st2))] |
| 66117 | pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) { | 65907 | pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) { |
| 66118 | unsafe extern "unadjusted" { | 65908 | crate::core_arch::macros::interleaving_store!(i32, 2, 2, a, b) |
| 66119 | #[cfg_attr( | ||
| 66120 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66121 | link_name = "llvm.aarch64.neon.st2.v2i32.p0" | ||
| 66122 | )] | ||
| 66123 | fn _vst2_s32(a: int32x2_t, b: int32x2_t, ptr: *mut i8); | ||
| 66124 | } | ||
| 66125 | _vst2_s32(b.0, b.1, a as _) | ||
| 66126 | } | 65909 | } |
| 66127 | #[doc = "Store multiple 2-element structures from two registers"] | 65910 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66128 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s32)"] | 65911 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2q_s32)"] |
| ... | @@ -66134,14 +65917,7 @@ pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) { | ... | @@ -66134,14 +65917,7 @@ pub unsafe fn vst2_s32(a: *mut i32, b: int32x2x2_t) { |
| 66134 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 65917 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66135 | #[cfg_attr(test, assert_instr(st2))] | 65918 | #[cfg_attr(test, assert_instr(st2))] |
| 66136 | pub unsafe fn vst2q_s32(a: *mut i32, b: int32x4x2_t) { | 65919 | pub unsafe fn vst2q_s32(a: *mut i32, b: int32x4x2_t) { |
| 66137 | unsafe extern "unadjusted" { | 65920 | crate::core_arch::macros::interleaving_store!(i32, 4, 2, a, b) |
| 66138 | #[cfg_attr( | ||
| 66139 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66140 | link_name = "llvm.aarch64.neon.st2.v4i32.p0" | ||
| 66141 | )] | ||
| 66142 | fn _vst2q_s32(a: int32x4_t, b: int32x4_t, ptr: *mut i8); | ||
| 66143 | } | ||
| 66144 | _vst2q_s32(b.0, b.1, a as _) | ||
| 66145 | } | 65921 | } |
| 66146 | #[doc = "Store multiple 2-element structures from two registers"] | 65922 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66147 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_f32)"] | 65923 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_f32)"] |
| ... | @@ -66865,11 +66641,7 @@ pub unsafe fn vst2_p64(a: *mut p64, b: poly64x1x2_t) { | ... | @@ -66865,11 +66641,7 @@ pub unsafe fn vst2_p64(a: *mut p64, b: poly64x1x2_t) { |
| 66865 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 66641 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 66866 | #[cfg_attr(test, assert_instr(nop))] | 66642 | #[cfg_attr(test, assert_instr(nop))] |
| 66867 | pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { | 66643 | pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { |
| 66868 | unsafe extern "unadjusted" { | 66644 | core::ptr::write_unaligned(a.cast(), b) |
| 66869 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst2.v1i64.p0")] | ||
| 66870 | fn _vst2_s64(ptr: *mut i8, a: int64x1_t, b: int64x1_t, size: i32); | ||
| 66871 | } | ||
| 66872 | _vst2_s64(a as _, b.0, b.1, 8) | ||
| 66873 | } | 66645 | } |
| 66874 | #[doc = "Store multiple 2-element structures from two registers"] | 66646 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66875 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s64)"] | 66647 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_s64)"] |
| ... | @@ -66881,14 +66653,7 @@ pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { | ... | @@ -66881,14 +66653,7 @@ pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { |
| 66881 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 66653 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 66882 | #[cfg_attr(test, assert_instr(nop))] | 66654 | #[cfg_attr(test, assert_instr(nop))] |
| 66883 | pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { | 66655 | pub unsafe fn vst2_s64(a: *mut i64, b: int64x1x2_t) { |
| 66884 | unsafe extern "unadjusted" { | 66656 | core::ptr::write_unaligned(a.cast(), b) |
| 66885 | #[cfg_attr( | ||
| 66886 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 66887 | link_name = "llvm.aarch64.neon.st2.v1i64.p0" | ||
| 66888 | )] | ||
| 66889 | fn _vst2_s64(a: int64x1_t, b: int64x1_t, ptr: *mut i8); | ||
| 66890 | } | ||
| 66891 | _vst2_s64(b.0, b.1, a as _) | ||
| 66892 | } | 66657 | } |
| 66893 | #[doc = "Store multiple 2-element structures from two registers"] | 66658 | #[doc = "Store multiple 2-element structures from two registers"] |
| 66894 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_u64)"] | 66659 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst2_u64)"] |
| ... | @@ -67233,11 +66998,7 @@ pub unsafe fn vst3q_f16(a: *mut f16, b: float16x8x3_t) { | ... | @@ -67233,11 +66998,7 @@ pub unsafe fn vst3q_f16(a: *mut f16, b: float16x8x3_t) { |
| 67233 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 66998 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67234 | #[cfg_attr(test, assert_instr(vst3))] | 66999 | #[cfg_attr(test, assert_instr(vst3))] |
| 67235 | pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) { | 67000 | pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) { |
| 67236 | unsafe extern "unadjusted" { | 67001 | crate::core_arch::macros::interleaving_store!(f32, 2, 3, a, b) |
| 67237 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v2f32")] | ||
| 67238 | fn _vst3_f32(ptr: *mut i8, a: float32x2_t, b: float32x2_t, c: float32x2_t, size: i32); | ||
| 67239 | } | ||
| 67240 | _vst3_f32(a as _, b.0, b.1, b.2, 4) | ||
| 67241 | } | 67002 | } |
| 67242 | #[doc = "Store multiple 3-element structures from three registers"] | 67003 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67243 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_f32)"] | 67004 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_f32)"] |
| ... | @@ -67249,11 +67010,7 @@ pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) { | ... | @@ -67249,11 +67010,7 @@ pub unsafe fn vst3_f32(a: *mut f32, b: float32x2x3_t) { |
| 67249 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67010 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67250 | #[cfg_attr(test, assert_instr(vst3))] | 67011 | #[cfg_attr(test, assert_instr(vst3))] |
| 67251 | pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) { | 67012 | pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) { |
| 67252 | unsafe extern "unadjusted" { | 67013 | crate::core_arch::macros::interleaving_store!(f32, 4, 3, a, b) |
| 67253 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v4f32")] | ||
| 67254 | fn _vst3q_f32(ptr: *mut i8, a: float32x4_t, b: float32x4_t, c: float32x4_t, size: i32); | ||
| 67255 | } | ||
| 67256 | _vst3q_f32(a as _, b.0, b.1, b.2, 4) | ||
| 67257 | } | 67014 | } |
| 67258 | #[doc = "Store multiple 3-element structures from three registers"] | 67015 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67259 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s8)"] | 67016 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s8)"] |
| ... | @@ -67265,11 +67022,7 @@ pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) { | ... | @@ -67265,11 +67022,7 @@ pub unsafe fn vst3q_f32(a: *mut f32, b: float32x4x3_t) { |
| 67265 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67022 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67266 | #[cfg_attr(test, assert_instr(vst3))] | 67023 | #[cfg_attr(test, assert_instr(vst3))] |
| 67267 | pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) { | 67024 | pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) { |
| 67268 | unsafe extern "unadjusted" { | 67025 | crate::core_arch::macros::interleaving_store!(i8, 8, 3, a, b) |
| 67269 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v8i8")] | ||
| 67270 | fn _vst3_s8(ptr: *mut i8, a: int8x8_t, b: int8x8_t, c: int8x8_t, size: i32); | ||
| 67271 | } | ||
| 67272 | _vst3_s8(a as _, b.0, b.1, b.2, 1) | ||
| 67273 | } | 67026 | } |
| 67274 | #[doc = "Store multiple 3-element structures from three registers"] | 67027 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67275 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s8)"] | 67028 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s8)"] |
| ... | @@ -67281,11 +67034,7 @@ pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) { | ... | @@ -67281,11 +67034,7 @@ pub unsafe fn vst3_s8(a: *mut i8, b: int8x8x3_t) { |
| 67281 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67034 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67282 | #[cfg_attr(test, assert_instr(vst3))] | 67035 | #[cfg_attr(test, assert_instr(vst3))] |
| 67283 | pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) { | 67036 | pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) { |
| 67284 | unsafe extern "unadjusted" { | 67037 | crate::core_arch::macros::interleaving_store!(i8, 16, 3, a, b) |
| 67285 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v16i8")] | ||
| 67286 | fn _vst3q_s8(ptr: *mut i8, a: int8x16_t, b: int8x16_t, c: int8x16_t, size: i32); | ||
| 67287 | } | ||
| 67288 | _vst3q_s8(a as _, b.0, b.1, b.2, 1) | ||
| 67289 | } | 67038 | } |
| 67290 | #[doc = "Store multiple 3-element structures from three registers"] | 67039 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67291 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s16)"] | 67040 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s16)"] |
| ... | @@ -67297,11 +67046,7 @@ pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) { | ... | @@ -67297,11 +67046,7 @@ pub unsafe fn vst3q_s8(a: *mut i8, b: int8x16x3_t) { |
| 67297 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67046 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67298 | #[cfg_attr(test, assert_instr(vst3))] | 67047 | #[cfg_attr(test, assert_instr(vst3))] |
| 67299 | pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) { | 67048 | pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) { |
| 67300 | unsafe extern "unadjusted" { | 67049 | crate::core_arch::macros::interleaving_store!(i16, 4, 3, a, b) |
| 67301 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v4i16")] | ||
| 67302 | fn _vst3_s16(ptr: *mut i8, a: int16x4_t, b: int16x4_t, c: int16x4_t, size: i32); | ||
| 67303 | } | ||
| 67304 | _vst3_s16(a as _, b.0, b.1, b.2, 2) | ||
| 67305 | } | 67050 | } |
| 67306 | #[doc = "Store multiple 3-element structures from three registers"] | 67051 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67307 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s16)"] | 67052 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s16)"] |
| ... | @@ -67313,11 +67058,7 @@ pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) { | ... | @@ -67313,11 +67058,7 @@ pub unsafe fn vst3_s16(a: *mut i16, b: int16x4x3_t) { |
| 67313 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67058 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67314 | #[cfg_attr(test, assert_instr(vst3))] | 67059 | #[cfg_attr(test, assert_instr(vst3))] |
| 67315 | pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) { | 67060 | pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) { |
| 67316 | unsafe extern "unadjusted" { | 67061 | crate::core_arch::macros::interleaving_store!(i16, 8, 3, a, b) |
| 67317 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v8i16")] | ||
| 67318 | fn _vst3q_s16(ptr: *mut i8, a: int16x8_t, b: int16x8_t, c: int16x8_t, size: i32); | ||
| 67319 | } | ||
| 67320 | _vst3q_s16(a as _, b.0, b.1, b.2, 2) | ||
| 67321 | } | 67062 | } |
| 67322 | #[doc = "Store multiple 3-element structures from three registers"] | 67063 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67323 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s32)"] | 67064 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s32)"] |
| ... | @@ -67329,11 +67070,7 @@ pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) { | ... | @@ -67329,11 +67070,7 @@ pub unsafe fn vst3q_s16(a: *mut i16, b: int16x8x3_t) { |
| 67329 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67070 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67330 | #[cfg_attr(test, assert_instr(vst3))] | 67071 | #[cfg_attr(test, assert_instr(vst3))] |
| 67331 | pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) { | 67072 | pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) { |
| 67332 | unsafe extern "unadjusted" { | 67073 | crate::core_arch::macros::interleaving_store!(i32, 2, 3, a, b) |
| 67333 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v2i32")] | ||
| 67334 | fn _vst3_s32(ptr: *mut i8, a: int32x2_t, b: int32x2_t, c: int32x2_t, size: i32); | ||
| 67335 | } | ||
| 67336 | _vst3_s32(a as _, b.0, b.1, b.2, 4) | ||
| 67337 | } | 67074 | } |
| 67338 | #[doc = "Store multiple 3-element structures from three registers"] | 67075 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67339 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s32)"] | 67076 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3q_s32)"] |
| ... | @@ -67345,11 +67082,7 @@ pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) { | ... | @@ -67345,11 +67082,7 @@ pub unsafe fn vst3_s32(a: *mut i32, b: int32x2x3_t) { |
| 67345 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67082 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 67346 | #[cfg_attr(test, assert_instr(vst3))] | 67083 | #[cfg_attr(test, assert_instr(vst3))] |
| 67347 | pub unsafe fn vst3q_s32(a: *mut i32, b: int32x4x3_t) { | 67084 | pub unsafe fn vst3q_s32(a: *mut i32, b: int32x4x3_t) { |
| 67348 | unsafe extern "unadjusted" { | 67085 | crate::core_arch::macros::interleaving_store!(i32, 4, 3, a, b) |
| 67349 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v4i32")] | ||
| 67350 | fn _vst3q_s32(ptr: *mut i8, a: int32x4_t, b: int32x4_t, c: int32x4_t, size: i32); | ||
| 67351 | } | ||
| 67352 | _vst3q_s32(a as _, b.0, b.1, b.2, 4) | ||
| 67353 | } | 67086 | } |
| 67354 | #[doc = "Store multiple 3-element structures from three registers"] | 67087 | #[doc = "Store multiple 3-element structures from three registers"] |
| 67355 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_f32)"] | 67088 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_f32)"] |
| ... | @@ -68153,14 +67886,7 @@ pub unsafe fn vst3_p64(a: *mut p64, b: poly64x1x3_t) { | ... | @@ -68153,14 +67886,7 @@ pub unsafe fn vst3_p64(a: *mut p64, b: poly64x1x3_t) { |
| 68153 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 67886 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68154 | #[cfg_attr(test, assert_instr(nop))] | 67887 | #[cfg_attr(test, assert_instr(nop))] |
| 68155 | pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { | 67888 | pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { |
| 68156 | unsafe extern "unadjusted" { | 67889 | core::ptr::write_unaligned(a.cast(), b) |
| 68157 | #[cfg_attr( | ||
| 68158 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68159 | link_name = "llvm.aarch64.neon.st3.v1i64.p0" | ||
| 68160 | )] | ||
| 68161 | fn _vst3_s64(a: int64x1_t, b: int64x1_t, c: int64x1_t, ptr: *mut i8); | ||
| 68162 | } | ||
| 68163 | _vst3_s64(b.0, b.1, b.2, a as _) | ||
| 68164 | } | 67890 | } |
| 68165 | #[doc = "Store multiple 3-element structures from three registers"] | 67891 | #[doc = "Store multiple 3-element structures from three registers"] |
| 68166 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s64)"] | 67892 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_s64)"] |
| ... | @@ -68172,11 +67898,7 @@ pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { | ... | @@ -68172,11 +67898,7 @@ pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { |
| 68172 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 67898 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 68173 | #[cfg_attr(test, assert_instr(nop))] | 67899 | #[cfg_attr(test, assert_instr(nop))] |
| 68174 | pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { | 67900 | pub unsafe fn vst3_s64(a: *mut i64, b: int64x1x3_t) { |
| 68175 | unsafe extern "unadjusted" { | 67901 | core::ptr::write_unaligned(a.cast(), b) |
| 68176 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst3.p0.v1i64")] | ||
| 68177 | fn _vst3_s64(ptr: *mut i8, a: int64x1_t, b: int64x1_t, c: int64x1_t, size: i32); | ||
| 68178 | } | ||
| 68179 | _vst3_s64(a as _, b.0, b.1, b.2, 8) | ||
| 68180 | } | 67902 | } |
| 68181 | #[doc = "Store multiple 3-element structures from three registers"] | 67903 | #[doc = "Store multiple 3-element structures from three registers"] |
| 68182 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_u64)"] | 67904 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst3_u64)"] |
| ... | @@ -68712,14 +68434,7 @@ pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) { | ... | @@ -68712,14 +68434,7 @@ pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) { |
| 68712 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68434 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68713 | #[cfg_attr(test, assert_instr(st4))] | 68435 | #[cfg_attr(test, assert_instr(st4))] |
| 68714 | pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) { | 68436 | pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) { |
| 68715 | unsafe extern "unadjusted" { | 68437 | crate::core_arch::macros::interleaving_store!(f32, 2, 4, a, b) |
| 68716 | #[cfg_attr( | ||
| 68717 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68718 | link_name = "llvm.aarch64.neon.st4.v2f32.p0" | ||
| 68719 | )] | ||
| 68720 | fn _vst4_f32(a: float32x2_t, b: float32x2_t, c: float32x2_t, d: float32x2_t, ptr: *mut i8); | ||
| 68721 | } | ||
| 68722 | _vst4_f32(b.0, b.1, b.2, b.3, a as _) | ||
| 68723 | } | 68438 | } |
| 68724 | #[doc = "Store multiple 4-element structures from four registers"] | 68439 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68725 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_f32)"] | 68440 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_f32)"] |
| ... | @@ -68731,14 +68446,7 @@ pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) { | ... | @@ -68731,14 +68446,7 @@ pub unsafe fn vst4_f32(a: *mut f32, b: float32x2x4_t) { |
| 68731 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68446 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68732 | #[cfg_attr(test, assert_instr(st4))] | 68447 | #[cfg_attr(test, assert_instr(st4))] |
| 68733 | pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) { | 68448 | pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) { |
| 68734 | unsafe extern "unadjusted" { | 68449 | crate::core_arch::macros::interleaving_store!(f32, 4, 4, a, b) |
| 68735 | #[cfg_attr( | ||
| 68736 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68737 | link_name = "llvm.aarch64.neon.st4.v4f32.p0" | ||
| 68738 | )] | ||
| 68739 | fn _vst4q_f32(a: float32x4_t, b: float32x4_t, c: float32x4_t, d: float32x4_t, ptr: *mut i8); | ||
| 68740 | } | ||
| 68741 | _vst4q_f32(b.0, b.1, b.2, b.3, a as _) | ||
| 68742 | } | 68450 | } |
| 68743 | #[doc = "Store multiple 4-element structures from four registers"] | 68451 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68744 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s8)"] | 68452 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s8)"] |
| ... | @@ -68750,14 +68458,7 @@ pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) { | ... | @@ -68750,14 +68458,7 @@ pub unsafe fn vst4q_f32(a: *mut f32, b: float32x4x4_t) { |
| 68750 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68458 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68751 | #[cfg_attr(test, assert_instr(st4))] | 68459 | #[cfg_attr(test, assert_instr(st4))] |
| 68752 | pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) { | 68460 | pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) { |
| 68753 | unsafe extern "unadjusted" { | 68461 | crate::core_arch::macros::interleaving_store!(i8, 8, 4, a, b) |
| 68754 | #[cfg_attr( | ||
| 68755 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68756 | link_name = "llvm.aarch64.neon.st4.v8i8.p0" | ||
| 68757 | )] | ||
| 68758 | fn _vst4_s8(a: int8x8_t, b: int8x8_t, c: int8x8_t, d: int8x8_t, ptr: *mut i8); | ||
| 68759 | } | ||
| 68760 | _vst4_s8(b.0, b.1, b.2, b.3, a as _) | ||
| 68761 | } | 68462 | } |
| 68762 | #[doc = "Store multiple 4-element structures from four registers"] | 68463 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68763 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s8)"] | 68464 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s8)"] |
| ... | @@ -68769,14 +68470,7 @@ pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) { | ... | @@ -68769,14 +68470,7 @@ pub unsafe fn vst4_s8(a: *mut i8, b: int8x8x4_t) { |
| 68769 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68470 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68770 | #[cfg_attr(test, assert_instr(st4))] | 68471 | #[cfg_attr(test, assert_instr(st4))] |
| 68771 | pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) { | 68472 | pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) { |
| 68772 | unsafe extern "unadjusted" { | 68473 | crate::core_arch::macros::interleaving_store!(i8, 16, 4, a, b) |
| 68773 | #[cfg_attr( | ||
| 68774 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68775 | link_name = "llvm.aarch64.neon.st4.v16i8.p0" | ||
| 68776 | )] | ||
| 68777 | fn _vst4q_s8(a: int8x16_t, b: int8x16_t, c: int8x16_t, d: int8x16_t, ptr: *mut i8); | ||
| 68778 | } | ||
| 68779 | _vst4q_s8(b.0, b.1, b.2, b.3, a as _) | ||
| 68780 | } | 68474 | } |
| 68781 | #[doc = "Store multiple 4-element structures from four registers"] | 68475 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68782 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s16)"] | 68476 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s16)"] |
| ... | @@ -68788,14 +68482,7 @@ pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) { | ... | @@ -68788,14 +68482,7 @@ pub unsafe fn vst4q_s8(a: *mut i8, b: int8x16x4_t) { |
| 68788 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68482 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68789 | #[cfg_attr(test, assert_instr(st4))] | 68483 | #[cfg_attr(test, assert_instr(st4))] |
| 68790 | pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) { | 68484 | pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) { |
| 68791 | unsafe extern "unadjusted" { | 68485 | crate::core_arch::macros::interleaving_store!(i16, 4, 4, a, b) |
| 68792 | #[cfg_attr( | ||
| 68793 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68794 | link_name = "llvm.aarch64.neon.st4.v4i16.p0" | ||
| 68795 | )] | ||
| 68796 | fn _vst4_s16(a: int16x4_t, b: int16x4_t, c: int16x4_t, d: int16x4_t, ptr: *mut i8); | ||
| 68797 | } | ||
| 68798 | _vst4_s16(b.0, b.1, b.2, b.3, a as _) | ||
| 68799 | } | 68486 | } |
| 68800 | #[doc = "Store multiple 4-element structures from four registers"] | 68487 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68801 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s16)"] | 68488 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s16)"] |
| ... | @@ -68807,14 +68494,7 @@ pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) { | ... | @@ -68807,14 +68494,7 @@ pub unsafe fn vst4_s16(a: *mut i16, b: int16x4x4_t) { |
| 68807 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68494 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68808 | #[cfg_attr(test, assert_instr(st4))] | 68495 | #[cfg_attr(test, assert_instr(st4))] |
| 68809 | pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) { | 68496 | pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) { |
| 68810 | unsafe extern "unadjusted" { | 68497 | crate::core_arch::macros::interleaving_store!(i16, 8, 4, a, b) |
| 68811 | #[cfg_attr( | ||
| 68812 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68813 | link_name = "llvm.aarch64.neon.st4.v8i16.p0" | ||
| 68814 | )] | ||
| 68815 | fn _vst4q_s16(a: int16x8_t, b: int16x8_t, c: int16x8_t, d: int16x8_t, ptr: *mut i8); | ||
| 68816 | } | ||
| 68817 | _vst4q_s16(b.0, b.1, b.2, b.3, a as _) | ||
| 68818 | } | 68498 | } |
| 68819 | #[doc = "Store multiple 4-element structures from four registers"] | 68499 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68820 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s32)"] | 68500 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s32)"] |
| ... | @@ -68826,14 +68506,7 @@ pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) { | ... | @@ -68826,14 +68506,7 @@ pub unsafe fn vst4q_s16(a: *mut i16, b: int16x8x4_t) { |
| 68826 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68506 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68827 | #[cfg_attr(test, assert_instr(st4))] | 68507 | #[cfg_attr(test, assert_instr(st4))] |
| 68828 | pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) { | 68508 | pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) { |
| 68829 | unsafe extern "unadjusted" { | 68509 | crate::core_arch::macros::interleaving_store!(i32, 2, 4, a, b) |
| 68830 | #[cfg_attr( | ||
| 68831 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68832 | link_name = "llvm.aarch64.neon.st4.v2i32.p0" | ||
| 68833 | )] | ||
| 68834 | fn _vst4_s32(a: int32x2_t, b: int32x2_t, c: int32x2_t, d: int32x2_t, ptr: *mut i8); | ||
| 68835 | } | ||
| 68836 | _vst4_s32(b.0, b.1, b.2, b.3, a as _) | ||
| 68837 | } | 68510 | } |
| 68838 | #[doc = "Store multiple 4-element structures from four registers"] | 68511 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68839 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s32)"] | 68512 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4q_s32)"] |
| ... | @@ -68845,14 +68518,7 @@ pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) { | ... | @@ -68845,14 +68518,7 @@ pub unsafe fn vst4_s32(a: *mut i32, b: int32x2x4_t) { |
| 68845 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 68518 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 68846 | #[cfg_attr(test, assert_instr(st4))] | 68519 | #[cfg_attr(test, assert_instr(st4))] |
| 68847 | pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) { | 68520 | pub unsafe fn vst4q_s32(a: *mut i32, b: int32x4x4_t) { |
| 68848 | unsafe extern "unadjusted" { | 68521 | crate::core_arch::macros::interleaving_store!(i32, 4, 4, a, b) |
| 68849 | #[cfg_attr( | ||
| 68850 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 68851 | link_name = "llvm.aarch64.neon.st4.v4i32.p0" | ||
| 68852 | )] | ||
| 68853 | fn _vst4q_s32(a: int32x4_t, b: int32x4_t, c: int32x4_t, d: int32x4_t, ptr: *mut i8); | ||
| 68854 | } | ||
| 68855 | _vst4q_s32(b.0, b.1, b.2, b.3, a as _) | ||
| 68856 | } | 68522 | } |
| 68857 | #[doc = "Store multiple 4-element structures from four registers"] | 68523 | #[doc = "Store multiple 4-element structures from four registers"] |
| 68858 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_lane_f16)"] | 68524 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_lane_f16)"] |
| ... | @@ -69576,18 +69242,7 @@ pub unsafe fn vst4_p64(a: *mut p64, b: poly64x1x4_t) { | ... | @@ -69576,18 +69242,7 @@ pub unsafe fn vst4_p64(a: *mut p64, b: poly64x1x4_t) { |
| 69576 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] | 69242 | #[unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")] |
| 69577 | #[cfg_attr(test, assert_instr(nop))] | 69243 | #[cfg_attr(test, assert_instr(nop))] |
| 69578 | pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { | 69244 | pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { |
| 69579 | unsafe extern "unadjusted" { | 69245 | core::ptr::write_unaligned(a.cast(), b) |
| 69580 | #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vst4.p0.v1i64")] | ||
| 69581 | fn _vst4_s64( | ||
| 69582 | ptr: *mut i8, | ||
| 69583 | a: int64x1_t, | ||
| 69584 | b: int64x1_t, | ||
| 69585 | c: int64x1_t, | ||
| 69586 | d: int64x1_t, | ||
| 69587 | size: i32, | ||
| 69588 | ); | ||
| 69589 | } | ||
| 69590 | _vst4_s64(a as _, b.0, b.1, b.2, b.3, 8) | ||
| 69591 | } | 69246 | } |
| 69592 | #[doc = "Store multiple 4-element structures from four registers"] | 69247 | #[doc = "Store multiple 4-element structures from four registers"] |
| 69593 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s64)"] | 69248 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_s64)"] |
| ... | @@ -69599,14 +69254,7 @@ pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { | ... | @@ -69599,14 +69254,7 @@ pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { |
| 69599 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] | 69254 | #[stable(feature = "neon_intrinsics", since = "1.59.0")] |
| 69600 | #[cfg_attr(test, assert_instr(nop))] | 69255 | #[cfg_attr(test, assert_instr(nop))] |
| 69601 | pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { | 69256 | pub unsafe fn vst4_s64(a: *mut i64, b: int64x1x4_t) { |
| 69602 | unsafe extern "unadjusted" { | 69257 | core::ptr::write_unaligned(a.cast(), b) |
| 69603 | #[cfg_attr( | ||
| 69604 | any(target_arch = "aarch64", target_arch = "arm64ec"), | ||
| 69605 | link_name = "llvm.aarch64.neon.st4.v1i64.p0" | ||
| 69606 | )] | ||
| 69607 | fn _vst4_s64(a: int64x1_t, b: int64x1_t, c: int64x1_t, d: int64x1_t, ptr: *mut i8); | ||
| 69608 | } | ||
| 69609 | _vst4_s64(b.0, b.1, b.2, b.3, a as _) | ||
| 69610 | } | 69258 | } |
| 69611 | #[doc = "Store multiple 4-element structures from four registers"] | 69259 | #[doc = "Store multiple 4-element structures from four registers"] |
| 69612 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_u64)"] | 69260 | #[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst4_u64)"] |
library/stdarch/crates/core_arch/src/macros.rs+88-6| ... | @@ -187,6 +187,17 @@ macro_rules! simd_masked_store { | ... | @@ -187,6 +187,17 @@ macro_rules! simd_masked_store { |
| 187 | }; | 187 | }; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | /// The first N indices `[0, 1, 2, ...]`. | ||
| 191 | pub(crate) const fn identity<const N: usize>() -> [u32; N] { | ||
| 192 | let mut out = [0u32; N]; | ||
| 193 | let mut i = 0usize; | ||
| 194 | while i < N { | ||
| 195 | out[i] = i as u32; | ||
| 196 | i += 1; | ||
| 197 | } | ||
| 198 | out | ||
| 199 | } | ||
| 200 | |||
| 190 | /// The first N even indices `[0, 2, 4, ...]`. | 201 | /// The first N even indices `[0, 2, 4, ...]`. |
| 191 | pub(crate) const fn even<const N: usize>() -> [u32; N] { | 202 | pub(crate) const fn even<const N: usize>() -> [u32; N] { |
| 192 | let mut out = [0u32; N]; | 203 | let mut out = [0u32; N]; |
| ... | @@ -226,12 +237,12 @@ macro_rules! deinterleaving_load { | ... | @@ -226,12 +237,12 @@ macro_rules! deinterleaving_load { |
| 226 | ($elem:ty, $lanes:literal, 2, $ptr:expr) => {{ | 237 | ($elem:ty, $lanes:literal, 2, $ptr:expr) => {{ |
| 227 | use $crate::core_arch::macros::deinterleave_mask; | 238 | use $crate::core_arch::macros::deinterleave_mask; |
| 228 | use $crate::core_arch::simd::Simd; | 239 | use $crate::core_arch::simd::Simd; |
| 229 | use $crate::{mem::transmute, ptr}; | 240 | use $crate::mem::transmute; |
| 230 | 241 | ||
| 231 | type V = Simd<$elem, $lanes>; | 242 | type V = Simd<$elem, $lanes>; |
| 232 | type W = Simd<$elem, { $lanes * 2 }>; | 243 | type W = Simd<$elem, { $lanes * 2 }>; |
| 233 | 244 | ||
| 234 | let w: W = ptr::read_unaligned($ptr as *const W); | 245 | let w: W = $crate::ptr::read_unaligned($ptr as *const W); |
| 235 | 246 | ||
| 236 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 2, 0>()); | 247 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 2, 0>()); |
| 237 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 2, 1>()); | 248 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 2, 1>()); |
| ... | @@ -242,12 +253,20 @@ macro_rules! deinterleaving_load { | ... | @@ -242,12 +253,20 @@ macro_rules! deinterleaving_load { |
| 242 | ($elem:ty, $lanes:literal, 3, $ptr:expr) => {{ | 253 | ($elem:ty, $lanes:literal, 3, $ptr:expr) => {{ |
| 243 | use $crate::core_arch::macros::deinterleave_mask; | 254 | use $crate::core_arch::macros::deinterleave_mask; |
| 244 | use $crate::core_arch::simd::Simd; | 255 | use $crate::core_arch::simd::Simd; |
| 245 | use $crate::{mem::transmute, ptr}; | 256 | use $crate::mem::{MaybeUninit, transmute}; |
| 246 | 257 | ||
| 247 | type V = Simd<$elem, $lanes>; | 258 | type V = Simd<$elem, $lanes>; |
| 248 | type W = Simd<$elem, { $lanes * 3 }>; | 259 | type W = Simd<$elem, { $lanes * 3 }>; |
| 249 | 260 | ||
| 250 | let w: W = ptr::read_unaligned($ptr as *const W); | 261 | // NOTE: repr(simd) adds padding to make the total size a power of two. |
| 262 | // Hence reading W from ptr might read out of bounds. | ||
| 263 | let mut mem = MaybeUninit::<W>::uninit(); | ||
| 264 | $crate::ptr::copy_nonoverlapping( | ||
| 265 | $ptr.cast::<$elem>(), | ||
| 266 | mem.as_mut_ptr().cast::<$elem>(), | ||
| 267 | $lanes * 3, | ||
| 268 | ); | ||
| 269 | let w = mem.assume_init(); | ||
| 251 | 270 | ||
| 252 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 3, 0>()); | 271 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 3, 0>()); |
| 253 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 3, 1>()); | 272 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 3, 1>()); |
| ... | @@ -259,12 +278,12 @@ macro_rules! deinterleaving_load { | ... | @@ -259,12 +278,12 @@ macro_rules! deinterleaving_load { |
| 259 | ($elem:ty, $lanes:literal, 4, $ptr:expr) => {{ | 278 | ($elem:ty, $lanes:literal, 4, $ptr:expr) => {{ |
| 260 | use $crate::core_arch::macros::deinterleave_mask; | 279 | use $crate::core_arch::macros::deinterleave_mask; |
| 261 | use $crate::core_arch::simd::Simd; | 280 | use $crate::core_arch::simd::Simd; |
| 262 | use $crate::{mem::transmute, ptr}; | 281 | use $crate::mem::transmute; |
| 263 | 282 | ||
| 264 | type V = Simd<$elem, $lanes>; | 283 | type V = Simd<$elem, $lanes>; |
| 265 | type W = Simd<$elem, { $lanes * 4 }>; | 284 | type W = Simd<$elem, { $lanes * 4 }>; |
| 266 | 285 | ||
| 267 | let w: W = ptr::read_unaligned($ptr as *const W); | 286 | let w: W = $crate::ptr::read_unaligned($ptr as *const W); |
| 268 | 287 | ||
| 269 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 4, 0>()); | 288 | let v0: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 4, 0>()); |
| 270 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 4, 1>()); | 289 | let v1: V = simd_shuffle!(w, w, deinterleave_mask::<$lanes, 4, 1>()); |
| ... | @@ -277,3 +296,66 @@ macro_rules! deinterleaving_load { | ... | @@ -277,3 +296,66 @@ macro_rules! deinterleaving_load { |
| 277 | 296 | ||
| 278 | #[allow(unused)] | 297 | #[allow(unused)] |
| 279 | pub(crate) use deinterleaving_load; | 298 | pub(crate) use deinterleaving_load; |
| 299 | |||
| 300 | pub(crate) const fn interleave_mask<const LANES: usize, const N: usize, const K: usize>() | ||
| 301 | -> [u32; LANES] { | ||
| 302 | let mut out = [0u32; LANES]; | ||
| 303 | let mut j = 0usize; | ||
| 304 | while j < LANES { | ||
| 305 | out[j] = ((j % K) * N + j / K) as u32; | ||
| 306 | j += 1; | ||
| 307 | } | ||
| 308 | out | ||
| 309 | } | ||
| 310 | |||
| 311 | #[allow(unused)] | ||
| 312 | macro_rules! interleaving_store { | ||
| 313 | ($elem:ty, $lanes:literal, 2, $ptr:expr, $v:expr) => {{ | ||
| 314 | use $crate::core_arch::macros::interleave_mask; | ||
| 315 | use $crate::core_arch::simd::Simd; | ||
| 316 | |||
| 317 | type W = Simd<$elem, { $lanes * 2 }>; | ||
| 318 | let w: W = simd_shuffle!($v.0, $v.1, interleave_mask::<{ $lanes * 2 }, $lanes, 2>()); | ||
| 319 | $crate::ptr::write_unaligned($ptr as *mut W, w); | ||
| 320 | }}; | ||
| 321 | |||
| 322 | // N = 3 | ||
| 323 | ($elem:ty, $lanes:literal, 3, $ptr:expr, $v:expr) => {{ | ||
| 324 | use $crate::core_arch::macros::{identity, interleave_mask}; | ||
| 325 | use $crate::core_arch::simd::Simd; | ||
| 326 | |||
| 327 | let v0v1: Simd<$elem, { $lanes * 2 }> = | ||
| 328 | simd_shuffle!($v.0, $v.1, identity::<{ $lanes * 2 }>()); | ||
| 329 | let v2v2: Simd<$elem, { $lanes * 2 }> = | ||
| 330 | simd_shuffle!($v.2, $v.2, identity::<{ $lanes * 2 }>()); | ||
| 331 | |||
| 332 | type W = Simd<$elem, { $lanes * 3 }>; | ||
| 333 | |||
| 334 | // NOTE: repr(simd) adds padding to make the total size a power of two. | ||
| 335 | // Hence writing W to ptr might write out of bounds. | ||
| 336 | let w: W = simd_shuffle!(v0v1, v2v2, interleave_mask::<{ $lanes * 3 }, $lanes, 3>()); | ||
| 337 | $crate::ptr::copy_nonoverlapping( | ||
| 338 | (&w as *const W).cast::<$elem>(), | ||
| 339 | $ptr.cast::<$elem>(), | ||
| 340 | $lanes * 3, | ||
| 341 | ); | ||
| 342 | }}; | ||
| 343 | |||
| 344 | // N = 4 | ||
| 345 | ($elem:ty, $lanes:literal, 4, $ptr:expr, $v:expr) => {{ | ||
| 346 | use $crate::core_arch::macros::{identity, interleave_mask}; | ||
| 347 | use $crate::core_arch::simd::Simd; | ||
| 348 | |||
| 349 | let v0v1: Simd<$elem, { $lanes * 2 }> = | ||
| 350 | simd_shuffle!($v.0, $v.1, identity::<{ $lanes * 2 }>()); | ||
| 351 | let v2v3: Simd<$elem, { $lanes * 2 }> = | ||
| 352 | simd_shuffle!($v.2, $v.3, identity::<{ $lanes * 2 }>()); | ||
| 353 | |||
| 354 | type W = Simd<$elem, { $lanes * 4 }>; | ||
| 355 | let w: W = simd_shuffle!(v0v1, v2v3, interleave_mask::<{ $lanes * 4 }, $lanes, 4>()); | ||
| 356 | $crate::ptr::write_unaligned($ptr as *mut W, w); | ||
| 357 | }}; | ||
| 358 | } | ||
| 359 | |||
| 360 | #[allow(unused)] | ||
| 361 | pub(crate) use interleaving_store; |
library/stdarch/crates/core_arch/src/x86/avx2.rs+104-24| ... | @@ -2315,7 +2315,7 @@ pub const fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { | ... | @@ -2315,7 +2315,7 @@ pub const fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { |
| 2315 | unsafe { transmute(simd_or(a.as_i32x8(), b.as_i32x8())) } | 2315 | unsafe { transmute(simd_or(a.as_i32x8(), b.as_i32x8())) } |
| 2316 | } | 2316 | } |
| 2317 | 2317 | ||
| 2318 | /// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers | 2318 | /// Converts packed signed 16-bit integers from `a` and `b` to packed 8-bit integers |
| 2319 | /// using signed saturation | 2319 | /// using signed saturation |
| 2320 | /// | 2320 | /// |
| 2321 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packs_epi16) | 2321 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packs_epi16) |
| ... | @@ -2323,11 +2323,33 @@ pub const fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { | ... | @@ -2323,11 +2323,33 @@ pub const fn _mm256_or_si256(a: __m256i, b: __m256i) -> __m256i { |
| 2323 | #[target_feature(enable = "avx2")] | 2323 | #[target_feature(enable = "avx2")] |
| 2324 | #[cfg_attr(test, assert_instr(vpacksswb))] | 2324 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 2325 | #[stable(feature = "simd_x86", since = "1.27.0")] | 2325 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 2326 | pub fn _mm256_packs_epi16(a: __m256i, b: __m256i) -> __m256i { | 2326 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 2327 | unsafe { transmute(packsswb(a.as_i16x16(), b.as_i16x16())) } | 2327 | pub const fn _mm256_packs_epi16(a: __m256i, b: __m256i) -> __m256i { |
| 2328 | unsafe { | ||
| 2329 | let max = simd_splat(i8::MAX as i16); | ||
| 2330 | let min = simd_splat(i8::MIN as i16); | ||
| 2331 | |||
| 2332 | let clamped_a = simd_imax(simd_imin(a.as_i16x16(), max), min) | ||
| 2333 | .as_m256i() | ||
| 2334 | .as_i8x32(); | ||
| 2335 | let clamped_b = simd_imax(simd_imin(b.as_i16x16(), max), min) | ||
| 2336 | .as_m256i() | ||
| 2337 | .as_i8x32(); | ||
| 2338 | |||
| 2339 | #[rustfmt::skip] | ||
| 2340 | const IDXS: [u32; 32] = [ | ||
| 2341 | 00, 02, 04, 06, 08, 10, 12, 14, // a-lo i16 to i8 conversions | ||
| 2342 | 32, 34, 36, 38, 40, 42, 44, 46, // b-lo | ||
| 2343 | 16, 18, 20, 22, 24, 26, 28, 30, // a-hi | ||
| 2344 | 48, 50, 52, 54, 56, 58, 60, 62, // b-hi | ||
| 2345 | ]; | ||
| 2346 | let result: i8x32 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 2347 | |||
| 2348 | result.as_m256i() | ||
| 2349 | } | ||
| 2328 | } | 2350 | } |
| 2329 | 2351 | ||
| 2330 | /// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers | 2352 | /// Converts packed signed 32-bit integers from `a` and `b` to packed 16-bit integers |
| 2331 | /// using signed saturation | 2353 | /// using signed saturation |
| 2332 | /// | 2354 | /// |
| 2333 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packs_epi32) | 2355 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packs_epi32) |
| ... | @@ -2335,11 +2357,33 @@ pub fn _mm256_packs_epi16(a: __m256i, b: __m256i) -> __m256i { | ... | @@ -2335,11 +2357,33 @@ pub fn _mm256_packs_epi16(a: __m256i, b: __m256i) -> __m256i { |
| 2335 | #[target_feature(enable = "avx2")] | 2357 | #[target_feature(enable = "avx2")] |
| 2336 | #[cfg_attr(test, assert_instr(vpackssdw))] | 2358 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 2337 | #[stable(feature = "simd_x86", since = "1.27.0")] | 2359 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 2338 | pub fn _mm256_packs_epi32(a: __m256i, b: __m256i) -> __m256i { | 2360 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 2339 | unsafe { transmute(packssdw(a.as_i32x8(), b.as_i32x8())) } | 2361 | pub const fn _mm256_packs_epi32(a: __m256i, b: __m256i) -> __m256i { |
| 2362 | unsafe { | ||
| 2363 | let max = simd_splat(i16::MAX as i32); | ||
| 2364 | let min = simd_splat(i16::MIN as i32); | ||
| 2365 | |||
| 2366 | let clamped_a = simd_imax(simd_imin(a.as_i32x8(), max), min) | ||
| 2367 | .as_m256i() | ||
| 2368 | .as_i16x16(); | ||
| 2369 | let clamped_b = simd_imax(simd_imin(b.as_i32x8(), max), min) | ||
| 2370 | .as_m256i() | ||
| 2371 | .as_i16x16(); | ||
| 2372 | |||
| 2373 | #[rustfmt::skip] | ||
| 2374 | const IDXS: [u32; 16] = [ | ||
| 2375 | 00, 02, 04, 06, // a-lo i32 to i16 conversions | ||
| 2376 | 16, 18, 20, 22, // b-lo | ||
| 2377 | 08, 10, 12, 14, // a-hi | ||
| 2378 | 24, 26, 28, 30, // b-hi | ||
| 2379 | ]; | ||
| 2380 | let result: i16x16 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 2381 | |||
| 2382 | result.as_m256i() | ||
| 2383 | } | ||
| 2340 | } | 2384 | } |
| 2341 | 2385 | ||
| 2342 | /// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers | 2386 | /// Converts packed signed 16-bit integers from `a` and `b` to packed 8-bit integers |
| 2343 | /// using unsigned saturation | 2387 | /// using unsigned saturation |
| 2344 | /// | 2388 | /// |
| 2345 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packus_epi16) | 2389 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packus_epi16) |
| ... | @@ -2347,11 +2391,33 @@ pub fn _mm256_packs_epi32(a: __m256i, b: __m256i) -> __m256i { | ... | @@ -2347,11 +2391,33 @@ pub fn _mm256_packs_epi32(a: __m256i, b: __m256i) -> __m256i { |
| 2347 | #[target_feature(enable = "avx2")] | 2391 | #[target_feature(enable = "avx2")] |
| 2348 | #[cfg_attr(test, assert_instr(vpackuswb))] | 2392 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 2349 | #[stable(feature = "simd_x86", since = "1.27.0")] | 2393 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 2350 | pub fn _mm256_packus_epi16(a: __m256i, b: __m256i) -> __m256i { | 2394 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 2351 | unsafe { transmute(packuswb(a.as_i16x16(), b.as_i16x16())) } | 2395 | pub const fn _mm256_packus_epi16(a: __m256i, b: __m256i) -> __m256i { |
| 2396 | unsafe { | ||
| 2397 | let max = simd_splat(u8::MAX as i16); | ||
| 2398 | let min = simd_splat(u8::MIN as i16); | ||
| 2399 | |||
| 2400 | let clamped_a = simd_imax(simd_imin(a.as_i16x16(), max), min) | ||
| 2401 | .as_m256i() | ||
| 2402 | .as_i8x32(); | ||
| 2403 | let clamped_b = simd_imax(simd_imin(b.as_i16x16(), max), min) | ||
| 2404 | .as_m256i() | ||
| 2405 | .as_i8x32(); | ||
| 2406 | |||
| 2407 | #[rustfmt::skip] | ||
| 2408 | const IDXS: [u32; 32] = [ | ||
| 2409 | 00, 02, 04, 06, 08, 10, 12, 14, // a-lo i16 to u8 conversions | ||
| 2410 | 32, 34, 36, 38, 40, 42, 44, 46, // b-lo | ||
| 2411 | 16, 18, 20, 22, 24, 26, 28, 30, // a-hi | ||
| 2412 | 48, 50, 52, 54, 56, 58, 60, 62, // b-hi | ||
| 2413 | ]; | ||
| 2414 | let result: i8x32 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 2415 | |||
| 2416 | result.as_m256i() | ||
| 2417 | } | ||
| 2352 | } | 2418 | } |
| 2353 | 2419 | ||
| 2354 | /// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers | 2420 | /// Converts packed signed 32-bit integers from `a` and `b` to packed 16-bit integers |
| 2355 | /// using unsigned saturation | 2421 | /// using unsigned saturation |
| 2356 | /// | 2422 | /// |
| 2357 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packus_epi32) | 2423 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packus_epi32) |
| ... | @@ -2359,8 +2425,30 @@ pub fn _mm256_packus_epi16(a: __m256i, b: __m256i) -> __m256i { | ... | @@ -2359,8 +2425,30 @@ pub fn _mm256_packus_epi16(a: __m256i, b: __m256i) -> __m256i { |
| 2359 | #[target_feature(enable = "avx2")] | 2425 | #[target_feature(enable = "avx2")] |
| 2360 | #[cfg_attr(test, assert_instr(vpackusdw))] | 2426 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 2361 | #[stable(feature = "simd_x86", since = "1.27.0")] | 2427 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 2362 | pub fn _mm256_packus_epi32(a: __m256i, b: __m256i) -> __m256i { | 2428 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 2363 | unsafe { transmute(packusdw(a.as_i32x8(), b.as_i32x8())) } | 2429 | pub const fn _mm256_packus_epi32(a: __m256i, b: __m256i) -> __m256i { |
| 2430 | unsafe { | ||
| 2431 | let max = simd_splat(u16::MAX as i32); | ||
| 2432 | let min = simd_splat(u16::MIN as i32); | ||
| 2433 | |||
| 2434 | let clamped_a = simd_imax(simd_imin(a.as_i32x8(), max), min) | ||
| 2435 | .as_m256i() | ||
| 2436 | .as_i16x16(); | ||
| 2437 | let clamped_b = simd_imax(simd_imin(b.as_i32x8(), max), min) | ||
| 2438 | .as_m256i() | ||
| 2439 | .as_i16x16(); | ||
| 2440 | |||
| 2441 | #[rustfmt::skip] | ||
| 2442 | const IDXS: [u32; 16] = [ | ||
| 2443 | 00, 02, 04, 06, // a-lo i32 to u16 conversions | ||
| 2444 | 16, 18, 20, 22, // b-lo | ||
| 2445 | 08, 10, 12, 14, // a-hi | ||
| 2446 | 24, 26, 28, 30, // b-hi | ||
| 2447 | ]; | ||
| 2448 | let result: i16x16 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 2449 | |||
| 2450 | result.as_m256i() | ||
| 2451 | } | ||
| 2364 | } | 2452 | } |
| 2365 | 2453 | ||
| 2366 | /// Permutes packed 32-bit integers from `a` according to the content of `b`. | 2454 | /// Permutes packed 32-bit integers from `a` according to the content of `b`. |
| ... | @@ -3827,14 +3915,6 @@ unsafe extern "C" { | ... | @@ -3827,14 +3915,6 @@ unsafe extern "C" { |
| 3827 | fn mpsadbw(a: u8x32, b: u8x32, imm8: i8) -> u16x16; | 3915 | fn mpsadbw(a: u8x32, b: u8x32, imm8: i8) -> u16x16; |
| 3828 | #[link_name = "llvm.x86.avx2.pmul.hr.sw"] | 3916 | #[link_name = "llvm.x86.avx2.pmul.hr.sw"] |
| 3829 | fn pmulhrsw(a: i16x16, b: i16x16) -> i16x16; | 3917 | fn pmulhrsw(a: i16x16, b: i16x16) -> i16x16; |
| 3830 | #[link_name = "llvm.x86.avx2.packsswb"] | ||
| 3831 | fn packsswb(a: i16x16, b: i16x16) -> i8x32; | ||
| 3832 | #[link_name = "llvm.x86.avx2.packssdw"] | ||
| 3833 | fn packssdw(a: i32x8, b: i32x8) -> i16x16; | ||
| 3834 | #[link_name = "llvm.x86.avx2.packuswb"] | ||
| 3835 | fn packuswb(a: i16x16, b: i16x16) -> u8x32; | ||
| 3836 | #[link_name = "llvm.x86.avx2.packusdw"] | ||
| 3837 | fn packusdw(a: i32x8, b: i32x8) -> u16x16; | ||
| 3838 | #[link_name = "llvm.x86.avx2.psad.bw"] | 3918 | #[link_name = "llvm.x86.avx2.psad.bw"] |
| 3839 | fn psadbw(a: u8x32, b: u8x32) -> u64x4; | 3919 | fn psadbw(a: u8x32, b: u8x32) -> u64x4; |
| 3840 | #[link_name = "llvm.x86.avx2.psign.b"] | 3920 | #[link_name = "llvm.x86.avx2.psign.b"] |
| ... | @@ -4988,7 +5068,7 @@ mod tests { | ... | @@ -4988,7 +5068,7 @@ mod tests { |
| 4988 | } | 5068 | } |
| 4989 | 5069 | ||
| 4990 | #[simd_test(enable = "avx2")] | 5070 | #[simd_test(enable = "avx2")] |
| 4991 | fn test_mm256_packs_epi16() { | 5071 | const fn test_mm256_packs_epi16() { |
| 4992 | let a = _mm256_set1_epi16(2); | 5072 | let a = _mm256_set1_epi16(2); |
| 4993 | let b = _mm256_set1_epi16(4); | 5073 | let b = _mm256_set1_epi16(4); |
| 4994 | let r = _mm256_packs_epi16(a, b); | 5074 | let r = _mm256_packs_epi16(a, b); |
| ... | @@ -5004,7 +5084,7 @@ mod tests { | ... | @@ -5004,7 +5084,7 @@ mod tests { |
| 5004 | } | 5084 | } |
| 5005 | 5085 | ||
| 5006 | #[simd_test(enable = "avx2")] | 5086 | #[simd_test(enable = "avx2")] |
| 5007 | fn test_mm256_packs_epi32() { | 5087 | const fn test_mm256_packs_epi32() { |
| 5008 | let a = _mm256_set1_epi32(2); | 5088 | let a = _mm256_set1_epi32(2); |
| 5009 | let b = _mm256_set1_epi32(4); | 5089 | let b = _mm256_set1_epi32(4); |
| 5010 | let r = _mm256_packs_epi32(a, b); | 5090 | let r = _mm256_packs_epi32(a, b); |
| ... | @@ -5014,7 +5094,7 @@ mod tests { | ... | @@ -5014,7 +5094,7 @@ mod tests { |
| 5014 | } | 5094 | } |
| 5015 | 5095 | ||
| 5016 | #[simd_test(enable = "avx2")] | 5096 | #[simd_test(enable = "avx2")] |
| 5017 | fn test_mm256_packus_epi16() { | 5097 | const fn test_mm256_packus_epi16() { |
| 5018 | let a = _mm256_set1_epi16(2); | 5098 | let a = _mm256_set1_epi16(2); |
| 5019 | let b = _mm256_set1_epi16(4); | 5099 | let b = _mm256_set1_epi16(4); |
| 5020 | let r = _mm256_packus_epi16(a, b); | 5100 | let r = _mm256_packus_epi16(a, b); |
| ... | @@ -5030,7 +5110,7 @@ mod tests { | ... | @@ -5030,7 +5110,7 @@ mod tests { |
| 5030 | } | 5110 | } |
| 5031 | 5111 | ||
| 5032 | #[simd_test(enable = "avx2")] | 5112 | #[simd_test(enable = "avx2")] |
| 5033 | fn test_mm256_packus_epi32() { | 5113 | const fn test_mm256_packus_epi32() { |
| 5034 | let a = _mm256_set1_epi32(2); | 5114 | let a = _mm256_set1_epi32(2); |
| 5035 | let b = _mm256_set1_epi32(4); | 5115 | let b = _mm256_set1_epi32(4); |
| 5036 | let r = _mm256_packus_epi32(a, b); | 5116 | let r = _mm256_packus_epi32(a, b); |
library/stdarch/crates/core_arch/src/x86/avx512bw.rs+225-67| ... | @@ -6523,8 +6523,34 @@ pub fn _mm_maskz_maddubs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ... | @@ -6523,8 +6523,34 @@ pub fn _mm_maskz_maddubs_epi16(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { |
| 6523 | #[target_feature(enable = "avx512bw")] | 6523 | #[target_feature(enable = "avx512bw")] |
| 6524 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6524 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6525 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6525 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6526 | pub fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i { | 6526 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6527 | unsafe { transmute(vpackssdw(a.as_i32x16(), b.as_i32x16())) } | 6527 | pub const fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i { |
| 6528 | unsafe { | ||
| 6529 | let max = simd_splat(i16::MAX as i32); | ||
| 6530 | let min = simd_splat(i16::MIN as i32); | ||
| 6531 | |||
| 6532 | let clamped_a = simd_imax(simd_imin(a.as_i32x16(), max), min) | ||
| 6533 | .as_m512i() | ||
| 6534 | .as_i16x32(); | ||
| 6535 | let clamped_b = simd_imax(simd_imin(b.as_i32x16(), max), min) | ||
| 6536 | .as_m512i() | ||
| 6537 | .as_i16x32(); | ||
| 6538 | |||
| 6539 | #[rustfmt::skip] | ||
| 6540 | const IDXS: [u32; 32] = [ | ||
| 6541 | 00, 02, 04, 06, | ||
| 6542 | 32, 34, 36, 38, | ||
| 6543 | 08, 10, 12, 14, | ||
| 6544 | 40, 42, 44, 46, | ||
| 6545 | 16, 18, 20, 22, | ||
| 6546 | 48, 50, 52, 54, | ||
| 6547 | 24, 26, 28, 30, | ||
| 6548 | 56, 58, 60, 62, | ||
| 6549 | ]; | ||
| 6550 | let result: i16x32 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 6551 | |||
| 6552 | result.as_m512i() | ||
| 6553 | } | ||
| 6528 | } | 6554 | } |
| 6529 | 6555 | ||
| 6530 | /// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). | 6556 | /// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). |
| ... | @@ -6534,7 +6560,13 @@ pub fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i { | ... | @@ -6534,7 +6560,13 @@ pub fn _mm512_packs_epi32(a: __m512i, b: __m512i) -> __m512i { |
| 6534 | #[target_feature(enable = "avx512bw")] | 6560 | #[target_feature(enable = "avx512bw")] |
| 6535 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6561 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6536 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6562 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6537 | pub fn _mm512_mask_packs_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | 6563 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6564 | pub const fn _mm512_mask_packs_epi32( | ||
| 6565 | src: __m512i, | ||
| 6566 | k: __mmask32, | ||
| 6567 | a: __m512i, | ||
| 6568 | b: __m512i, | ||
| 6569 | ) -> __m512i { | ||
| 6538 | unsafe { | 6570 | unsafe { |
| 6539 | let pack = _mm512_packs_epi32(a, b).as_i16x32(); | 6571 | let pack = _mm512_packs_epi32(a, b).as_i16x32(); |
| 6540 | transmute(simd_select_bitmask(k, pack, src.as_i16x32())) | 6572 | transmute(simd_select_bitmask(k, pack, src.as_i16x32())) |
| ... | @@ -6548,7 +6580,8 @@ pub fn _mm512_mask_packs_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512 | ... | @@ -6548,7 +6580,8 @@ pub fn _mm512_mask_packs_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512 |
| 6548 | #[target_feature(enable = "avx512bw")] | 6580 | #[target_feature(enable = "avx512bw")] |
| 6549 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6581 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6550 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6582 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6551 | pub fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | 6583 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6584 | pub const fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | ||
| 6552 | unsafe { | 6585 | unsafe { |
| 6553 | let pack = _mm512_packs_epi32(a, b).as_i16x32(); | 6586 | let pack = _mm512_packs_epi32(a, b).as_i16x32(); |
| 6554 | transmute(simd_select_bitmask(k, pack, i16x32::ZERO)) | 6587 | transmute(simd_select_bitmask(k, pack, i16x32::ZERO)) |
| ... | @@ -6562,7 +6595,13 @@ pub fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i | ... | @@ -6562,7 +6595,13 @@ pub fn _mm512_maskz_packs_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i |
| 6562 | #[target_feature(enable = "avx512bw,avx512vl")] | 6595 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6563 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6596 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6564 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6597 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6565 | pub fn _mm256_mask_packs_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { | 6598 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6599 | pub const fn _mm256_mask_packs_epi32( | ||
| 6600 | src: __m256i, | ||
| 6601 | k: __mmask16, | ||
| 6602 | a: __m256i, | ||
| 6603 | b: __m256i, | ||
| 6604 | ) -> __m256i { | ||
| 6566 | unsafe { | 6605 | unsafe { |
| 6567 | let pack = _mm256_packs_epi32(a, b).as_i16x16(); | 6606 | let pack = _mm256_packs_epi32(a, b).as_i16x16(); |
| 6568 | transmute(simd_select_bitmask(k, pack, src.as_i16x16())) | 6607 | transmute(simd_select_bitmask(k, pack, src.as_i16x16())) |
| ... | @@ -6590,7 +6629,8 @@ pub fn _mm256_maskz_packs_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i | ... | @@ -6590,7 +6629,8 @@ pub fn _mm256_maskz_packs_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i |
| 6590 | #[target_feature(enable = "avx512bw,avx512vl")] | 6629 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6591 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6630 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6592 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6631 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6593 | pub fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | 6632 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6633 | pub const fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ||
| 6594 | unsafe { | 6634 | unsafe { |
| 6595 | let pack = _mm_packs_epi32(a, b).as_i16x8(); | 6635 | let pack = _mm_packs_epi32(a, b).as_i16x8(); |
| 6596 | transmute(simd_select_bitmask(k, pack, src.as_i16x8())) | 6636 | transmute(simd_select_bitmask(k, pack, src.as_i16x8())) |
| ... | @@ -6604,7 +6644,8 @@ pub fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - | ... | @@ -6604,7 +6644,8 @@ pub fn _mm_mask_packs_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) - |
| 6604 | #[target_feature(enable = "avx512bw,avx512vl")] | 6644 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6605 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6645 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6606 | #[cfg_attr(test, assert_instr(vpackssdw))] | 6646 | #[cfg_attr(test, assert_instr(vpackssdw))] |
| 6607 | pub fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | 6647 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6648 | pub const fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ||
| 6608 | unsafe { | 6649 | unsafe { |
| 6609 | let pack = _mm_packs_epi32(a, b).as_i16x8(); | 6650 | let pack = _mm_packs_epi32(a, b).as_i16x8(); |
| 6610 | transmute(simd_select_bitmask(k, pack, i16x8::ZERO)) | 6651 | transmute(simd_select_bitmask(k, pack, i16x8::ZERO)) |
| ... | @@ -6618,8 +6659,34 @@ pub fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ... | @@ -6618,8 +6659,34 @@ pub fn _mm_maskz_packs_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { |
| 6618 | #[target_feature(enable = "avx512bw")] | 6659 | #[target_feature(enable = "avx512bw")] |
| 6619 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6660 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6620 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6661 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6621 | pub fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i { | 6662 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6622 | unsafe { transmute(vpacksswb(a.as_i16x32(), b.as_i16x32())) } | 6663 | pub const fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i { |
| 6664 | unsafe { | ||
| 6665 | let max = simd_splat(i8::MAX as i16); | ||
| 6666 | let min = simd_splat(i8::MIN as i16); | ||
| 6667 | |||
| 6668 | let clamped_a = simd_imax(simd_imin(a.as_i16x32(), max), min) | ||
| 6669 | .as_m512i() | ||
| 6670 | .as_i8x64(); | ||
| 6671 | let clamped_b = simd_imax(simd_imin(b.as_i16x32(), max), min) | ||
| 6672 | .as_m512i() | ||
| 6673 | .as_i8x64(); | ||
| 6674 | |||
| 6675 | #[rustfmt::skip] | ||
| 6676 | const IDXS: [u32; 64] = [ | ||
| 6677 | 000, 002, 004, 006, 008, 010, 012, 014, | ||
| 6678 | 064, 066, 068, 070, 072, 074, 076, 078, | ||
| 6679 | 016, 018, 020, 022, 024, 026, 028, 030, | ||
| 6680 | 080, 082, 084, 086, 088, 090, 092, 094, | ||
| 6681 | 032, 034, 036, 038, 040, 042, 044, 046, | ||
| 6682 | 096, 098, 100, 102, 104, 106, 108, 110, | ||
| 6683 | 048, 050, 052, 054, 056, 058, 060, 062, | ||
| 6684 | 112, 114, 116, 118, 120, 122, 124, 126, | ||
| 6685 | ]; | ||
| 6686 | let result: i8x64 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 6687 | |||
| 6688 | result.as_m512i() | ||
| 6689 | } | ||
| 6623 | } | 6690 | } |
| 6624 | 6691 | ||
| 6625 | /// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). | 6692 | /// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using signed saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). |
| ... | @@ -6629,7 +6696,13 @@ pub fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i { | ... | @@ -6629,7 +6696,13 @@ pub fn _mm512_packs_epi16(a: __m512i, b: __m512i) -> __m512i { |
| 6629 | #[target_feature(enable = "avx512bw")] | 6696 | #[target_feature(enable = "avx512bw")] |
| 6630 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6697 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6631 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6698 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6632 | pub fn _mm512_mask_packs_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | 6699 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6700 | pub const fn _mm512_mask_packs_epi16( | ||
| 6701 | src: __m512i, | ||
| 6702 | k: __mmask64, | ||
| 6703 | a: __m512i, | ||
| 6704 | b: __m512i, | ||
| 6705 | ) -> __m512i { | ||
| 6633 | unsafe { | 6706 | unsafe { |
| 6634 | let pack = _mm512_packs_epi16(a, b).as_i8x64(); | 6707 | let pack = _mm512_packs_epi16(a, b).as_i8x64(); |
| 6635 | transmute(simd_select_bitmask(k, pack, src.as_i8x64())) | 6708 | transmute(simd_select_bitmask(k, pack, src.as_i8x64())) |
| ... | @@ -6643,7 +6716,8 @@ pub fn _mm512_mask_packs_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512 | ... | @@ -6643,7 +6716,8 @@ pub fn _mm512_mask_packs_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512 |
| 6643 | #[target_feature(enable = "avx512bw")] | 6716 | #[target_feature(enable = "avx512bw")] |
| 6644 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6717 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6645 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6718 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6646 | pub fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | 6719 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6720 | pub const fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | ||
| 6647 | unsafe { | 6721 | unsafe { |
| 6648 | let pack = _mm512_packs_epi16(a, b).as_i8x64(); | 6722 | let pack = _mm512_packs_epi16(a, b).as_i8x64(); |
| 6649 | transmute(simd_select_bitmask(k, pack, i8x64::ZERO)) | 6723 | transmute(simd_select_bitmask(k, pack, i8x64::ZERO)) |
| ... | @@ -6657,7 +6731,13 @@ pub fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i | ... | @@ -6657,7 +6731,13 @@ pub fn _mm512_maskz_packs_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i |
| 6657 | #[target_feature(enable = "avx512bw,avx512vl")] | 6731 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6658 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6732 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6659 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6733 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6660 | pub fn _mm256_mask_packs_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | 6734 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6735 | pub const fn _mm256_mask_packs_epi16( | ||
| 6736 | src: __m256i, | ||
| 6737 | k: __mmask32, | ||
| 6738 | a: __m256i, | ||
| 6739 | b: __m256i, | ||
| 6740 | ) -> __m256i { | ||
| 6661 | unsafe { | 6741 | unsafe { |
| 6662 | let pack = _mm256_packs_epi16(a, b).as_i8x32(); | 6742 | let pack = _mm256_packs_epi16(a, b).as_i8x32(); |
| 6663 | transmute(simd_select_bitmask(k, pack, src.as_i8x32())) | 6743 | transmute(simd_select_bitmask(k, pack, src.as_i8x32())) |
| ... | @@ -6671,7 +6751,8 @@ pub fn _mm256_mask_packs_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256 | ... | @@ -6671,7 +6751,8 @@ pub fn _mm256_mask_packs_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256 |
| 6671 | #[target_feature(enable = "avx512bw,avx512vl")] | 6751 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6672 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6752 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6673 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6753 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6674 | pub fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | 6754 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6755 | pub const fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | ||
| 6675 | unsafe { | 6756 | unsafe { |
| 6676 | let pack = _mm256_packs_epi16(a, b).as_i8x32(); | 6757 | let pack = _mm256_packs_epi16(a, b).as_i8x32(); |
| 6677 | transmute(simd_select_bitmask(k, pack, i8x32::ZERO)) | 6758 | transmute(simd_select_bitmask(k, pack, i8x32::ZERO)) |
| ... | @@ -6685,7 +6766,8 @@ pub fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i | ... | @@ -6685,7 +6766,8 @@ pub fn _mm256_maskz_packs_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i |
| 6685 | #[target_feature(enable = "avx512bw,avx512vl")] | 6766 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6686 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6767 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6687 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6768 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6688 | pub fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | 6769 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6770 | pub const fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | ||
| 6689 | unsafe { | 6771 | unsafe { |
| 6690 | let pack = _mm_packs_epi16(a, b).as_i8x16(); | 6772 | let pack = _mm_packs_epi16(a, b).as_i8x16(); |
| 6691 | transmute(simd_select_bitmask(k, pack, src.as_i8x16())) | 6773 | transmute(simd_select_bitmask(k, pack, src.as_i8x16())) |
| ... | @@ -6699,7 +6781,8 @@ pub fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) | ... | @@ -6699,7 +6781,8 @@ pub fn _mm_mask_packs_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) |
| 6699 | #[target_feature(enable = "avx512bw,avx512vl")] | 6781 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6700 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6782 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6701 | #[cfg_attr(test, assert_instr(vpacksswb))] | 6783 | #[cfg_attr(test, assert_instr(vpacksswb))] |
| 6702 | pub fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | 6784 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6785 | pub const fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | ||
| 6703 | unsafe { | 6786 | unsafe { |
| 6704 | let pack = _mm_packs_epi16(a, b).as_i8x16(); | 6787 | let pack = _mm_packs_epi16(a, b).as_i8x16(); |
| 6705 | transmute(simd_select_bitmask(k, pack, i8x16::ZERO)) | 6788 | transmute(simd_select_bitmask(k, pack, i8x16::ZERO)) |
| ... | @@ -6713,8 +6796,34 @@ pub fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | ... | @@ -6713,8 +6796,34 @@ pub fn _mm_maskz_packs_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { |
| 6713 | #[target_feature(enable = "avx512bw")] | 6796 | #[target_feature(enable = "avx512bw")] |
| 6714 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6797 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6715 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6798 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6716 | pub fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i { | 6799 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6717 | unsafe { transmute(vpackusdw(a.as_i32x16(), b.as_i32x16())) } | 6800 | pub const fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i { |
| 6801 | unsafe { | ||
| 6802 | let max = simd_splat(u16::MAX as i32); | ||
| 6803 | let min = simd_splat(u16::MIN as i32); | ||
| 6804 | |||
| 6805 | let clamped_a = simd_imax(simd_imin(a.as_i32x16(), max), min) | ||
| 6806 | .as_m512i() | ||
| 6807 | .as_i16x32(); | ||
| 6808 | let clamped_b = simd_imax(simd_imin(b.as_i32x16(), max), min) | ||
| 6809 | .as_m512i() | ||
| 6810 | .as_i16x32(); | ||
| 6811 | |||
| 6812 | #[rustfmt::skip] | ||
| 6813 | const IDXS: [u32; 32] = [ | ||
| 6814 | 00, 02, 04, 06, | ||
| 6815 | 32, 34, 36, 38, | ||
| 6816 | 08, 10, 12, 14, | ||
| 6817 | 40, 42, 44, 46, | ||
| 6818 | 16, 18, 20, 22, | ||
| 6819 | 48, 50, 52, 54, | ||
| 6820 | 24, 26, 28, 30, | ||
| 6821 | 56, 58, 60, 62, | ||
| 6822 | ]; | ||
| 6823 | let result: i16x32 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 6824 | |||
| 6825 | result.as_m512i() | ||
| 6826 | } | ||
| 6718 | } | 6827 | } |
| 6719 | 6828 | ||
| 6720 | /// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). | 6829 | /// Convert packed signed 32-bit integers from a and b to packed 16-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). |
| ... | @@ -6724,7 +6833,13 @@ pub fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i { | ... | @@ -6724,7 +6833,13 @@ pub fn _mm512_packus_epi32(a: __m512i, b: __m512i) -> __m512i { |
| 6724 | #[target_feature(enable = "avx512bw")] | 6833 | #[target_feature(enable = "avx512bw")] |
| 6725 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6834 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6726 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6835 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6727 | pub fn _mm512_mask_packus_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | 6836 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6837 | pub const fn _mm512_mask_packus_epi32( | ||
| 6838 | src: __m512i, | ||
| 6839 | k: __mmask32, | ||
| 6840 | a: __m512i, | ||
| 6841 | b: __m512i, | ||
| 6842 | ) -> __m512i { | ||
| 6728 | unsafe { | 6843 | unsafe { |
| 6729 | let pack = _mm512_packus_epi32(a, b).as_i16x32(); | 6844 | let pack = _mm512_packus_epi32(a, b).as_i16x32(); |
| 6730 | transmute(simd_select_bitmask(k, pack, src.as_i16x32())) | 6845 | transmute(simd_select_bitmask(k, pack, src.as_i16x32())) |
| ... | @@ -6738,7 +6853,8 @@ pub fn _mm512_mask_packus_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m51 | ... | @@ -6738,7 +6853,8 @@ pub fn _mm512_mask_packus_epi32(src: __m512i, k: __mmask32, a: __m512i, b: __m51 |
| 6738 | #[target_feature(enable = "avx512bw")] | 6853 | #[target_feature(enable = "avx512bw")] |
| 6739 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6854 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6740 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6855 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6741 | pub fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | 6856 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6857 | pub const fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512i { | ||
| 6742 | unsafe { | 6858 | unsafe { |
| 6743 | let pack = _mm512_packus_epi32(a, b).as_i16x32(); | 6859 | let pack = _mm512_packus_epi32(a, b).as_i16x32(); |
| 6744 | transmute(simd_select_bitmask(k, pack, i16x32::ZERO)) | 6860 | transmute(simd_select_bitmask(k, pack, i16x32::ZERO)) |
| ... | @@ -6752,7 +6868,13 @@ pub fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512 | ... | @@ -6752,7 +6868,13 @@ pub fn _mm512_maskz_packus_epi32(k: __mmask32, a: __m512i, b: __m512i) -> __m512 |
| 6752 | #[target_feature(enable = "avx512bw,avx512vl")] | 6868 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6753 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6869 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6754 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6870 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6755 | pub fn _mm256_mask_packus_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m256i) -> __m256i { | 6871 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6872 | pub const fn _mm256_mask_packus_epi32( | ||
| 6873 | src: __m256i, | ||
| 6874 | k: __mmask16, | ||
| 6875 | a: __m256i, | ||
| 6876 | b: __m256i, | ||
| 6877 | ) -> __m256i { | ||
| 6756 | unsafe { | 6878 | unsafe { |
| 6757 | let pack = _mm256_packus_epi32(a, b).as_i16x16(); | 6879 | let pack = _mm256_packus_epi32(a, b).as_i16x16(); |
| 6758 | transmute(simd_select_bitmask(k, pack, src.as_i16x16())) | 6880 | transmute(simd_select_bitmask(k, pack, src.as_i16x16())) |
| ... | @@ -6766,7 +6888,8 @@ pub fn _mm256_mask_packus_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m25 | ... | @@ -6766,7 +6888,8 @@ pub fn _mm256_mask_packus_epi32(src: __m256i, k: __mmask16, a: __m256i, b: __m25 |
| 6766 | #[target_feature(enable = "avx512bw,avx512vl")] | 6888 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6767 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6889 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6768 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6890 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6769 | pub fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { | 6891 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6892 | pub const fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256i { | ||
| 6770 | unsafe { | 6893 | unsafe { |
| 6771 | let pack = _mm256_packus_epi32(a, b).as_i16x16(); | 6894 | let pack = _mm256_packus_epi32(a, b).as_i16x16(); |
| 6772 | transmute(simd_select_bitmask(k, pack, i16x16::ZERO)) | 6895 | transmute(simd_select_bitmask(k, pack, i16x16::ZERO)) |
| ... | @@ -6780,7 +6903,8 @@ pub fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256 | ... | @@ -6780,7 +6903,8 @@ pub fn _mm256_maskz_packus_epi32(k: __mmask16, a: __m256i, b: __m256i) -> __m256 |
| 6780 | #[target_feature(enable = "avx512bw,avx512vl")] | 6903 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6781 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6904 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6782 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6905 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6783 | pub fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | 6906 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6907 | pub const fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ||
| 6784 | unsafe { | 6908 | unsafe { |
| 6785 | let pack = _mm_packus_epi32(a, b).as_i16x8(); | 6909 | let pack = _mm_packus_epi32(a, b).as_i16x8(); |
| 6786 | transmute(simd_select_bitmask(k, pack, src.as_i16x8())) | 6910 | transmute(simd_select_bitmask(k, pack, src.as_i16x8())) |
| ... | @@ -6794,7 +6918,8 @@ pub fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) | ... | @@ -6794,7 +6918,8 @@ pub fn _mm_mask_packus_epi32(src: __m128i, k: __mmask8, a: __m128i, b: __m128i) |
| 6794 | #[target_feature(enable = "avx512bw,avx512vl")] | 6918 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6795 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6919 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6796 | #[cfg_attr(test, assert_instr(vpackusdw))] | 6920 | #[cfg_attr(test, assert_instr(vpackusdw))] |
| 6797 | pub fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | 6921 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6922 | pub const fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ||
| 6798 | unsafe { | 6923 | unsafe { |
| 6799 | let pack = _mm_packus_epi32(a, b).as_i16x8(); | 6924 | let pack = _mm_packus_epi32(a, b).as_i16x8(); |
| 6800 | transmute(simd_select_bitmask(k, pack, i16x8::ZERO)) | 6925 | transmute(simd_select_bitmask(k, pack, i16x8::ZERO)) |
| ... | @@ -6808,8 +6933,34 @@ pub fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { | ... | @@ -6808,8 +6933,34 @@ pub fn _mm_maskz_packus_epi32(k: __mmask8, a: __m128i, b: __m128i) -> __m128i { |
| 6808 | #[target_feature(enable = "avx512bw")] | 6933 | #[target_feature(enable = "avx512bw")] |
| 6809 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6934 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6810 | #[cfg_attr(test, assert_instr(vpackuswb))] | 6935 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6811 | pub fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i { | 6936 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6812 | unsafe { transmute(vpackuswb(a.as_i16x32(), b.as_i16x32())) } | 6937 | pub const fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i { |
| 6938 | unsafe { | ||
| 6939 | let max = simd_splat(u8::MAX as i16); | ||
| 6940 | let min = simd_splat(u8::MIN as i16); | ||
| 6941 | |||
| 6942 | let clamped_a = simd_imax(simd_imin(a.as_i16x32(), max), min) | ||
| 6943 | .as_m512i() | ||
| 6944 | .as_i8x64(); | ||
| 6945 | let clamped_b = simd_imax(simd_imin(b.as_i16x32(), max), min) | ||
| 6946 | .as_m512i() | ||
| 6947 | .as_i8x64(); | ||
| 6948 | |||
| 6949 | #[rustfmt::skip] | ||
| 6950 | const IDXS: [u32; 64] = [ | ||
| 6951 | 000, 002, 004, 006, 008, 010, 012, 014, | ||
| 6952 | 064, 066, 068, 070, 072, 074, 076, 078, | ||
| 6953 | 016, 018, 020, 022, 024, 026, 028, 030, | ||
| 6954 | 080, 082, 084, 086, 088, 090, 092, 094, | ||
| 6955 | 032, 034, 036, 038, 040, 042, 044, 046, | ||
| 6956 | 096, 098, 100, 102, 104, 106, 108, 110, | ||
| 6957 | 048, 050, 052, 054, 056, 058, 060, 062, | ||
| 6958 | 112, 114, 116, 118, 120, 122, 124, 126, | ||
| 6959 | ]; | ||
| 6960 | let result: i8x64 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 6961 | |||
| 6962 | result.as_m512i() | ||
| 6963 | } | ||
| 6813 | } | 6964 | } |
| 6814 | 6965 | ||
| 6815 | /// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). | 6966 | /// Convert packed signed 16-bit integers from a and b to packed 8-bit integers using unsigned saturation, and store the results in dst using writemask k (elements are copied from src when the corresponding mask bit is not set). |
| ... | @@ -6819,7 +6970,13 @@ pub fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i { | ... | @@ -6819,7 +6970,13 @@ pub fn _mm512_packus_epi16(a: __m512i, b: __m512i) -> __m512i { |
| 6819 | #[target_feature(enable = "avx512bw")] | 6970 | #[target_feature(enable = "avx512bw")] |
| 6820 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6971 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6821 | #[cfg_attr(test, assert_instr(vpackuswb))] | 6972 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6822 | pub fn _mm512_mask_packus_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | 6973 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6974 | pub const fn _mm512_mask_packus_epi16( | ||
| 6975 | src: __m512i, | ||
| 6976 | k: __mmask64, | ||
| 6977 | a: __m512i, | ||
| 6978 | b: __m512i, | ||
| 6979 | ) -> __m512i { | ||
| 6823 | unsafe { | 6980 | unsafe { |
| 6824 | let pack = _mm512_packus_epi16(a, b).as_i8x64(); | 6981 | let pack = _mm512_packus_epi16(a, b).as_i8x64(); |
| 6825 | transmute(simd_select_bitmask(k, pack, src.as_i8x64())) | 6982 | transmute(simd_select_bitmask(k, pack, src.as_i8x64())) |
| ... | @@ -6833,7 +6990,8 @@ pub fn _mm512_mask_packus_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m51 | ... | @@ -6833,7 +6990,8 @@ pub fn _mm512_mask_packus_epi16(src: __m512i, k: __mmask64, a: __m512i, b: __m51 |
| 6833 | #[target_feature(enable = "avx512bw")] | 6990 | #[target_feature(enable = "avx512bw")] |
| 6834 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 6991 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6835 | #[cfg_attr(test, assert_instr(vpackuswb))] | 6992 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6836 | pub fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | 6993 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 6994 | pub const fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512i { | ||
| 6837 | unsafe { | 6995 | unsafe { |
| 6838 | let pack = _mm512_packus_epi16(a, b).as_i8x64(); | 6996 | let pack = _mm512_packus_epi16(a, b).as_i8x64(); |
| 6839 | transmute(simd_select_bitmask(k, pack, i8x64::ZERO)) | 6997 | transmute(simd_select_bitmask(k, pack, i8x64::ZERO)) |
| ... | @@ -6847,7 +7005,13 @@ pub fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512 | ... | @@ -6847,7 +7005,13 @@ pub fn _mm512_maskz_packus_epi16(k: __mmask64, a: __m512i, b: __m512i) -> __m512 |
| 6847 | #[target_feature(enable = "avx512bw,avx512vl")] | 7005 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6848 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 7006 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6849 | #[cfg_attr(test, assert_instr(vpackuswb))] | 7007 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6850 | pub fn _mm256_mask_packus_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | 7008 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 7009 | pub const fn _mm256_mask_packus_epi16( | ||
| 7010 | src: __m256i, | ||
| 7011 | k: __mmask32, | ||
| 7012 | a: __m256i, | ||
| 7013 | b: __m256i, | ||
| 7014 | ) -> __m256i { | ||
| 6851 | unsafe { | 7015 | unsafe { |
| 6852 | let pack = _mm256_packus_epi16(a, b).as_i8x32(); | 7016 | let pack = _mm256_packus_epi16(a, b).as_i8x32(); |
| 6853 | transmute(simd_select_bitmask(k, pack, src.as_i8x32())) | 7017 | transmute(simd_select_bitmask(k, pack, src.as_i8x32())) |
| ... | @@ -6861,7 +7025,8 @@ pub fn _mm256_mask_packus_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m25 | ... | @@ -6861,7 +7025,8 @@ pub fn _mm256_mask_packus_epi16(src: __m256i, k: __mmask32, a: __m256i, b: __m25 |
| 6861 | #[target_feature(enable = "avx512bw,avx512vl")] | 7025 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6862 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 7026 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6863 | #[cfg_attr(test, assert_instr(vpackuswb))] | 7027 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6864 | pub fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | 7028 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 7029 | pub const fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256i { | ||
| 6865 | unsafe { | 7030 | unsafe { |
| 6866 | let pack = _mm256_packus_epi16(a, b).as_i8x32(); | 7031 | let pack = _mm256_packus_epi16(a, b).as_i8x32(); |
| 6867 | transmute(simd_select_bitmask(k, pack, i8x32::ZERO)) | 7032 | transmute(simd_select_bitmask(k, pack, i8x32::ZERO)) |
| ... | @@ -6875,7 +7040,8 @@ pub fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256 | ... | @@ -6875,7 +7040,8 @@ pub fn _mm256_maskz_packus_epi16(k: __mmask32, a: __m256i, b: __m256i) -> __m256 |
| 6875 | #[target_feature(enable = "avx512bw,avx512vl")] | 7040 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6876 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 7041 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6877 | #[cfg_attr(test, assert_instr(vpackuswb))] | 7042 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6878 | pub fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | 7043 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 7044 | pub const fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | ||
| 6879 | unsafe { | 7045 | unsafe { |
| 6880 | let pack = _mm_packus_epi16(a, b).as_i8x16(); | 7046 | let pack = _mm_packus_epi16(a, b).as_i8x16(); |
| 6881 | transmute(simd_select_bitmask(k, pack, src.as_i8x16())) | 7047 | transmute(simd_select_bitmask(k, pack, src.as_i8x16())) |
| ... | @@ -6889,7 +7055,8 @@ pub fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) | ... | @@ -6889,7 +7055,8 @@ pub fn _mm_mask_packus_epi16(src: __m128i, k: __mmask16, a: __m128i, b: __m128i) |
| 6889 | #[target_feature(enable = "avx512bw,avx512vl")] | 7055 | #[target_feature(enable = "avx512bw,avx512vl")] |
| 6890 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] | 7056 | #[stable(feature = "stdarch_x86_avx512", since = "1.89")] |
| 6891 | #[cfg_attr(test, assert_instr(vpackuswb))] | 7057 | #[cfg_attr(test, assert_instr(vpackuswb))] |
| 6892 | pub fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | 7058 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 7059 | pub const fn _mm_maskz_packus_epi16(k: __mmask16, a: __m128i, b: __m128i) -> __m128i { | ||
| 6893 | unsafe { | 7060 | unsafe { |
| 6894 | let pack = _mm_packus_epi16(a, b).as_i8x16(); | 7061 | let pack = _mm_packus_epi16(a, b).as_i8x16(); |
| 6895 | transmute(simd_select_bitmask(k, pack, i8x16::ZERO)) | 7062 | transmute(simd_select_bitmask(k, pack, i8x16::ZERO)) |
| ... | @@ -12606,15 +12773,6 @@ unsafe extern "C" { | ... | @@ -12606,15 +12773,6 @@ unsafe extern "C" { |
| 12606 | #[link_name = "llvm.x86.avx512.pmaddubs.w.512"] | 12773 | #[link_name = "llvm.x86.avx512.pmaddubs.w.512"] |
| 12607 | fn vpmaddubsw(a: u8x64, b: i8x64) -> i16x32; | 12774 | fn vpmaddubsw(a: u8x64, b: i8x64) -> i16x32; |
| 12608 | 12775 | ||
| 12609 | #[link_name = "llvm.x86.avx512.packssdw.512"] | ||
| 12610 | fn vpackssdw(a: i32x16, b: i32x16) -> i16x32; | ||
| 12611 | #[link_name = "llvm.x86.avx512.packsswb.512"] | ||
| 12612 | fn vpacksswb(a: i16x32, b: i16x32) -> i8x64; | ||
| 12613 | #[link_name = "llvm.x86.avx512.packusdw.512"] | ||
| 12614 | fn vpackusdw(a: i32x16, b: i32x16) -> u16x32; | ||
| 12615 | #[link_name = "llvm.x86.avx512.packuswb.512"] | ||
| 12616 | fn vpackuswb(a: i16x32, b: i16x32) -> u8x64; | ||
| 12617 | |||
| 12618 | #[link_name = "llvm.x86.avx512.psll.w.512"] | 12776 | #[link_name = "llvm.x86.avx512.psll.w.512"] |
| 12619 | fn vpsllw(a: i16x32, count: i16x8) -> i16x32; | 12777 | fn vpsllw(a: i16x32, count: i16x8) -> i16x32; |
| 12620 | 12778 | ||
| ... | @@ -17702,7 +17860,7 @@ mod tests { | ... | @@ -17702,7 +17860,7 @@ mod tests { |
| 17702 | } | 17860 | } |
| 17703 | 17861 | ||
| 17704 | #[simd_test(enable = "avx512bw")] | 17862 | #[simd_test(enable = "avx512bw")] |
| 17705 | fn test_mm512_packs_epi32() { | 17863 | const fn test_mm512_packs_epi32() { |
| 17706 | let a = _mm512_set1_epi32(i32::MAX); | 17864 | let a = _mm512_set1_epi32(i32::MAX); |
| 17707 | let b = _mm512_set1_epi32(1); | 17865 | let b = _mm512_set1_epi32(1); |
| 17708 | let r = _mm512_packs_epi32(a, b); | 17866 | let r = _mm512_packs_epi32(a, b); |
| ... | @@ -17713,7 +17871,7 @@ mod tests { | ... | @@ -17713,7 +17871,7 @@ mod tests { |
| 17713 | } | 17871 | } |
| 17714 | 17872 | ||
| 17715 | #[simd_test(enable = "avx512bw")] | 17873 | #[simd_test(enable = "avx512bw")] |
| 17716 | fn test_mm512_mask_packs_epi32() { | 17874 | const fn test_mm512_mask_packs_epi32() { |
| 17717 | let a = _mm512_set1_epi32(i32::MAX); | 17875 | let a = _mm512_set1_epi32(i32::MAX); |
| 17718 | let b = _mm512_set1_epi32(1 << 16 | 1); | 17876 | let b = _mm512_set1_epi32(1 << 16 | 1); |
| 17719 | let r = _mm512_mask_packs_epi32(a, 0, a, b); | 17877 | let r = _mm512_mask_packs_epi32(a, 0, a, b); |
| ... | @@ -17726,7 +17884,7 @@ mod tests { | ... | @@ -17726,7 +17884,7 @@ mod tests { |
| 17726 | } | 17884 | } |
| 17727 | 17885 | ||
| 17728 | #[simd_test(enable = "avx512bw")] | 17886 | #[simd_test(enable = "avx512bw")] |
| 17729 | fn test_mm512_maskz_packs_epi32() { | 17887 | const fn test_mm512_maskz_packs_epi32() { |
| 17730 | let a = _mm512_set1_epi32(i32::MAX); | 17888 | let a = _mm512_set1_epi32(i32::MAX); |
| 17731 | let b = _mm512_set1_epi32(1); | 17889 | let b = _mm512_set1_epi32(1); |
| 17732 | let r = _mm512_maskz_packs_epi32(0, a, b); | 17890 | let r = _mm512_maskz_packs_epi32(0, a, b); |
| ... | @@ -17739,7 +17897,7 @@ mod tests { | ... | @@ -17739,7 +17897,7 @@ mod tests { |
| 17739 | } | 17897 | } |
| 17740 | 17898 | ||
| 17741 | #[simd_test(enable = "avx512bw,avx512vl")] | 17899 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17742 | fn test_mm256_mask_packs_epi32() { | 17900 | const fn test_mm256_mask_packs_epi32() { |
| 17743 | let a = _mm256_set1_epi32(i32::MAX); | 17901 | let a = _mm256_set1_epi32(i32::MAX); |
| 17744 | let b = _mm256_set1_epi32(1 << 16 | 1); | 17902 | let b = _mm256_set1_epi32(1 << 16 | 1); |
| 17745 | let r = _mm256_mask_packs_epi32(a, 0, a, b); | 17903 | let r = _mm256_mask_packs_epi32(a, 0, a, b); |
| ... | @@ -17763,7 +17921,7 @@ mod tests { | ... | @@ -17763,7 +17921,7 @@ mod tests { |
| 17763 | } | 17921 | } |
| 17764 | 17922 | ||
| 17765 | #[simd_test(enable = "avx512bw,avx512vl")] | 17923 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17766 | fn test_mm_mask_packs_epi32() { | 17924 | const fn test_mm_mask_packs_epi32() { |
| 17767 | let a = _mm_set1_epi32(i32::MAX); | 17925 | let a = _mm_set1_epi32(i32::MAX); |
| 17768 | let b = _mm_set1_epi32(1 << 16 | 1); | 17926 | let b = _mm_set1_epi32(1 << 16 | 1); |
| 17769 | let r = _mm_mask_packs_epi32(a, 0, a, b); | 17927 | let r = _mm_mask_packs_epi32(a, 0, a, b); |
| ... | @@ -17774,7 +17932,7 @@ mod tests { | ... | @@ -17774,7 +17932,7 @@ mod tests { |
| 17774 | } | 17932 | } |
| 17775 | 17933 | ||
| 17776 | #[simd_test(enable = "avx512bw,avx512vl")] | 17934 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17777 | fn test_mm_maskz_packs_epi32() { | 17935 | const fn test_mm_maskz_packs_epi32() { |
| 17778 | let a = _mm_set1_epi32(i32::MAX); | 17936 | let a = _mm_set1_epi32(i32::MAX); |
| 17779 | let b = _mm_set1_epi32(1); | 17937 | let b = _mm_set1_epi32(1); |
| 17780 | let r = _mm_maskz_packs_epi32(0, a, b); | 17938 | let r = _mm_maskz_packs_epi32(0, a, b); |
| ... | @@ -17785,7 +17943,7 @@ mod tests { | ... | @@ -17785,7 +17943,7 @@ mod tests { |
| 17785 | } | 17943 | } |
| 17786 | 17944 | ||
| 17787 | #[simd_test(enable = "avx512bw")] | 17945 | #[simd_test(enable = "avx512bw")] |
| 17788 | fn test_mm512_packs_epi16() { | 17946 | const fn test_mm512_packs_epi16() { |
| 17789 | let a = _mm512_set1_epi16(i16::MAX); | 17947 | let a = _mm512_set1_epi16(i16::MAX); |
| 17790 | let b = _mm512_set1_epi16(1); | 17948 | let b = _mm512_set1_epi16(1); |
| 17791 | let r = _mm512_packs_epi16(a, b); | 17949 | let r = _mm512_packs_epi16(a, b); |
| ... | @@ -17798,7 +17956,7 @@ mod tests { | ... | @@ -17798,7 +17956,7 @@ mod tests { |
| 17798 | } | 17956 | } |
| 17799 | 17957 | ||
| 17800 | #[simd_test(enable = "avx512bw")] | 17958 | #[simd_test(enable = "avx512bw")] |
| 17801 | fn test_mm512_mask_packs_epi16() { | 17959 | const fn test_mm512_mask_packs_epi16() { |
| 17802 | let a = _mm512_set1_epi16(i16::MAX); | 17960 | let a = _mm512_set1_epi16(i16::MAX); |
| 17803 | let b = _mm512_set1_epi16(1 << 8 | 1); | 17961 | let b = _mm512_set1_epi16(1 << 8 | 1); |
| 17804 | let r = _mm512_mask_packs_epi16(a, 0, a, b); | 17962 | let r = _mm512_mask_packs_epi16(a, 0, a, b); |
| ... | @@ -17818,7 +17976,7 @@ mod tests { | ... | @@ -17818,7 +17976,7 @@ mod tests { |
| 17818 | } | 17976 | } |
| 17819 | 17977 | ||
| 17820 | #[simd_test(enable = "avx512bw")] | 17978 | #[simd_test(enable = "avx512bw")] |
| 17821 | fn test_mm512_maskz_packs_epi16() { | 17979 | const fn test_mm512_maskz_packs_epi16() { |
| 17822 | let a = _mm512_set1_epi16(i16::MAX); | 17980 | let a = _mm512_set1_epi16(i16::MAX); |
| 17823 | let b = _mm512_set1_epi16(1); | 17981 | let b = _mm512_set1_epi16(1); |
| 17824 | let r = _mm512_maskz_packs_epi16(0, a, b); | 17982 | let r = _mm512_maskz_packs_epi16(0, a, b); |
| ... | @@ -17837,7 +17995,7 @@ mod tests { | ... | @@ -17837,7 +17995,7 @@ mod tests { |
| 17837 | } | 17995 | } |
| 17838 | 17996 | ||
| 17839 | #[simd_test(enable = "avx512bw,avx512vl")] | 17997 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17840 | fn test_mm256_mask_packs_epi16() { | 17998 | const fn test_mm256_mask_packs_epi16() { |
| 17841 | let a = _mm256_set1_epi16(i16::MAX); | 17999 | let a = _mm256_set1_epi16(i16::MAX); |
| 17842 | let b = _mm256_set1_epi16(1 << 8 | 1); | 18000 | let b = _mm256_set1_epi16(1 << 8 | 1); |
| 17843 | let r = _mm256_mask_packs_epi16(a, 0, a, b); | 18001 | let r = _mm256_mask_packs_epi16(a, 0, a, b); |
| ... | @@ -17850,7 +18008,7 @@ mod tests { | ... | @@ -17850,7 +18008,7 @@ mod tests { |
| 17850 | } | 18008 | } |
| 17851 | 18009 | ||
| 17852 | #[simd_test(enable = "avx512bw,avx512vl")] | 18010 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17853 | fn test_mm256_maskz_packs_epi16() { | 18011 | const fn test_mm256_maskz_packs_epi16() { |
| 17854 | let a = _mm256_set1_epi16(i16::MAX); | 18012 | let a = _mm256_set1_epi16(i16::MAX); |
| 17855 | let b = _mm256_set1_epi16(1); | 18013 | let b = _mm256_set1_epi16(1); |
| 17856 | let r = _mm256_maskz_packs_epi16(0, a, b); | 18014 | let r = _mm256_maskz_packs_epi16(0, a, b); |
| ... | @@ -17863,7 +18021,7 @@ mod tests { | ... | @@ -17863,7 +18021,7 @@ mod tests { |
| 17863 | } | 18021 | } |
| 17864 | 18022 | ||
| 17865 | #[simd_test(enable = "avx512bw,avx512vl")] | 18023 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17866 | fn test_mm_mask_packs_epi16() { | 18024 | const fn test_mm_mask_packs_epi16() { |
| 17867 | let a = _mm_set1_epi16(i16::MAX); | 18025 | let a = _mm_set1_epi16(i16::MAX); |
| 17868 | let b = _mm_set1_epi16(1 << 8 | 1); | 18026 | let b = _mm_set1_epi16(1 << 8 | 1); |
| 17869 | let r = _mm_mask_packs_epi16(a, 0, a, b); | 18027 | let r = _mm_mask_packs_epi16(a, 0, a, b); |
| ... | @@ -17875,7 +18033,7 @@ mod tests { | ... | @@ -17875,7 +18033,7 @@ mod tests { |
| 17875 | } | 18033 | } |
| 17876 | 18034 | ||
| 17877 | #[simd_test(enable = "avx512bw,avx512vl")] | 18035 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17878 | fn test_mm_maskz_packs_epi16() { | 18036 | const fn test_mm_maskz_packs_epi16() { |
| 17879 | let a = _mm_set1_epi16(i16::MAX); | 18037 | let a = _mm_set1_epi16(i16::MAX); |
| 17880 | let b = _mm_set1_epi16(1); | 18038 | let b = _mm_set1_epi16(1); |
| 17881 | let r = _mm_maskz_packs_epi16(0, a, b); | 18039 | let r = _mm_maskz_packs_epi16(0, a, b); |
| ... | @@ -17887,7 +18045,7 @@ mod tests { | ... | @@ -17887,7 +18045,7 @@ mod tests { |
| 17887 | } | 18045 | } |
| 17888 | 18046 | ||
| 17889 | #[simd_test(enable = "avx512bw")] | 18047 | #[simd_test(enable = "avx512bw")] |
| 17890 | fn test_mm512_packus_epi32() { | 18048 | const fn test_mm512_packus_epi32() { |
| 17891 | let a = _mm512_set1_epi32(-1); | 18049 | let a = _mm512_set1_epi32(-1); |
| 17892 | let b = _mm512_set1_epi32(1); | 18050 | let b = _mm512_set1_epi32(1); |
| 17893 | let r = _mm512_packus_epi32(a, b); | 18051 | let r = _mm512_packus_epi32(a, b); |
| ... | @@ -17898,7 +18056,7 @@ mod tests { | ... | @@ -17898,7 +18056,7 @@ mod tests { |
| 17898 | } | 18056 | } |
| 17899 | 18057 | ||
| 17900 | #[simd_test(enable = "avx512bw")] | 18058 | #[simd_test(enable = "avx512bw")] |
| 17901 | fn test_mm512_mask_packus_epi32() { | 18059 | const fn test_mm512_mask_packus_epi32() { |
| 17902 | let a = _mm512_set1_epi32(-1); | 18060 | let a = _mm512_set1_epi32(-1); |
| 17903 | let b = _mm512_set1_epi32(1 << 16 | 1); | 18061 | let b = _mm512_set1_epi32(1 << 16 | 1); |
| 17904 | let r = _mm512_mask_packus_epi32(a, 0, a, b); | 18062 | let r = _mm512_mask_packus_epi32(a, 0, a, b); |
| ... | @@ -17911,7 +18069,7 @@ mod tests { | ... | @@ -17911,7 +18069,7 @@ mod tests { |
| 17911 | } | 18069 | } |
| 17912 | 18070 | ||
| 17913 | #[simd_test(enable = "avx512bw")] | 18071 | #[simd_test(enable = "avx512bw")] |
| 17914 | fn test_mm512_maskz_packus_epi32() { | 18072 | const fn test_mm512_maskz_packus_epi32() { |
| 17915 | let a = _mm512_set1_epi32(-1); | 18073 | let a = _mm512_set1_epi32(-1); |
| 17916 | let b = _mm512_set1_epi32(1); | 18074 | let b = _mm512_set1_epi32(1); |
| 17917 | let r = _mm512_maskz_packus_epi32(0, a, b); | 18075 | let r = _mm512_maskz_packus_epi32(0, a, b); |
| ... | @@ -17924,7 +18082,7 @@ mod tests { | ... | @@ -17924,7 +18082,7 @@ mod tests { |
| 17924 | } | 18082 | } |
| 17925 | 18083 | ||
| 17926 | #[simd_test(enable = "avx512bw,avx512vl")] | 18084 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17927 | fn test_mm256_mask_packus_epi32() { | 18085 | const fn test_mm256_mask_packus_epi32() { |
| 17928 | let a = _mm256_set1_epi32(-1); | 18086 | let a = _mm256_set1_epi32(-1); |
| 17929 | let b = _mm256_set1_epi32(1 << 16 | 1); | 18087 | let b = _mm256_set1_epi32(1 << 16 | 1); |
| 17930 | let r = _mm256_mask_packus_epi32(a, 0, a, b); | 18088 | let r = _mm256_mask_packus_epi32(a, 0, a, b); |
| ... | @@ -17935,7 +18093,7 @@ mod tests { | ... | @@ -17935,7 +18093,7 @@ mod tests { |
| 17935 | } | 18093 | } |
| 17936 | 18094 | ||
| 17937 | #[simd_test(enable = "avx512bw,avx512vl")] | 18095 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17938 | fn test_mm256_maskz_packus_epi32() { | 18096 | const fn test_mm256_maskz_packus_epi32() { |
| 17939 | let a = _mm256_set1_epi32(-1); | 18097 | let a = _mm256_set1_epi32(-1); |
| 17940 | let b = _mm256_set1_epi32(1); | 18098 | let b = _mm256_set1_epi32(1); |
| 17941 | let r = _mm256_maskz_packus_epi32(0, a, b); | 18099 | let r = _mm256_maskz_packus_epi32(0, a, b); |
| ... | @@ -17946,7 +18104,7 @@ mod tests { | ... | @@ -17946,7 +18104,7 @@ mod tests { |
| 17946 | } | 18104 | } |
| 17947 | 18105 | ||
| 17948 | #[simd_test(enable = "avx512bw,avx512vl")] | 18106 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17949 | fn test_mm_mask_packus_epi32() { | 18107 | const fn test_mm_mask_packus_epi32() { |
| 17950 | let a = _mm_set1_epi32(-1); | 18108 | let a = _mm_set1_epi32(-1); |
| 17951 | let b = _mm_set1_epi32(1 << 16 | 1); | 18109 | let b = _mm_set1_epi32(1 << 16 | 1); |
| 17952 | let r = _mm_mask_packus_epi32(a, 0, a, b); | 18110 | let r = _mm_mask_packus_epi32(a, 0, a, b); |
| ... | @@ -17957,7 +18115,7 @@ mod tests { | ... | @@ -17957,7 +18115,7 @@ mod tests { |
| 17957 | } | 18115 | } |
| 17958 | 18116 | ||
| 17959 | #[simd_test(enable = "avx512bw,avx512vl")] | 18117 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 17960 | fn test_mm_maskz_packus_epi32() { | 18118 | const fn test_mm_maskz_packus_epi32() { |
| 17961 | let a = _mm_set1_epi32(-1); | 18119 | let a = _mm_set1_epi32(-1); |
| 17962 | let b = _mm_set1_epi32(1); | 18120 | let b = _mm_set1_epi32(1); |
| 17963 | let r = _mm_maskz_packus_epi32(0, a, b); | 18121 | let r = _mm_maskz_packus_epi32(0, a, b); |
| ... | @@ -17968,7 +18126,7 @@ mod tests { | ... | @@ -17968,7 +18126,7 @@ mod tests { |
| 17968 | } | 18126 | } |
| 17969 | 18127 | ||
| 17970 | #[simd_test(enable = "avx512bw")] | 18128 | #[simd_test(enable = "avx512bw")] |
| 17971 | fn test_mm512_packus_epi16() { | 18129 | const fn test_mm512_packus_epi16() { |
| 17972 | let a = _mm512_set1_epi16(-1); | 18130 | let a = _mm512_set1_epi16(-1); |
| 17973 | let b = _mm512_set1_epi16(1); | 18131 | let b = _mm512_set1_epi16(1); |
| 17974 | let r = _mm512_packus_epi16(a, b); | 18132 | let r = _mm512_packus_epi16(a, b); |
| ... | @@ -17981,7 +18139,7 @@ mod tests { | ... | @@ -17981,7 +18139,7 @@ mod tests { |
| 17981 | } | 18139 | } |
| 17982 | 18140 | ||
| 17983 | #[simd_test(enable = "avx512bw")] | 18141 | #[simd_test(enable = "avx512bw")] |
| 17984 | fn test_mm512_mask_packus_epi16() { | 18142 | const fn test_mm512_mask_packus_epi16() { |
| 17985 | let a = _mm512_set1_epi16(-1); | 18143 | let a = _mm512_set1_epi16(-1); |
| 17986 | let b = _mm512_set1_epi16(1 << 8 | 1); | 18144 | let b = _mm512_set1_epi16(1 << 8 | 1); |
| 17987 | let r = _mm512_mask_packus_epi16(a, 0, a, b); | 18145 | let r = _mm512_mask_packus_epi16(a, 0, a, b); |
| ... | @@ -18001,7 +18159,7 @@ mod tests { | ... | @@ -18001,7 +18159,7 @@ mod tests { |
| 18001 | } | 18159 | } |
| 18002 | 18160 | ||
| 18003 | #[simd_test(enable = "avx512bw")] | 18161 | #[simd_test(enable = "avx512bw")] |
| 18004 | fn test_mm512_maskz_packus_epi16() { | 18162 | const fn test_mm512_maskz_packus_epi16() { |
| 18005 | let a = _mm512_set1_epi16(-1); | 18163 | let a = _mm512_set1_epi16(-1); |
| 18006 | let b = _mm512_set1_epi16(1); | 18164 | let b = _mm512_set1_epi16(1); |
| 18007 | let r = _mm512_maskz_packus_epi16(0, a, b); | 18165 | let r = _mm512_maskz_packus_epi16(0, a, b); |
| ... | @@ -18020,7 +18178,7 @@ mod tests { | ... | @@ -18020,7 +18178,7 @@ mod tests { |
| 18020 | } | 18178 | } |
| 18021 | 18179 | ||
| 18022 | #[simd_test(enable = "avx512bw,avx512vl")] | 18180 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 18023 | fn test_mm256_mask_packus_epi16() { | 18181 | const fn test_mm256_mask_packus_epi16() { |
| 18024 | let a = _mm256_set1_epi16(-1); | 18182 | let a = _mm256_set1_epi16(-1); |
| 18025 | let b = _mm256_set1_epi16(1 << 8 | 1); | 18183 | let b = _mm256_set1_epi16(1 << 8 | 1); |
| 18026 | let r = _mm256_mask_packus_epi16(a, 0, a, b); | 18184 | let r = _mm256_mask_packus_epi16(a, 0, a, b); |
| ... | @@ -18033,7 +18191,7 @@ mod tests { | ... | @@ -18033,7 +18191,7 @@ mod tests { |
| 18033 | } | 18191 | } |
| 18034 | 18192 | ||
| 18035 | #[simd_test(enable = "avx512bw,avx512vl")] | 18193 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 18036 | fn test_mm256_maskz_packus_epi16() { | 18194 | const fn test_mm256_maskz_packus_epi16() { |
| 18037 | let a = _mm256_set1_epi16(-1); | 18195 | let a = _mm256_set1_epi16(-1); |
| 18038 | let b = _mm256_set1_epi16(1); | 18196 | let b = _mm256_set1_epi16(1); |
| 18039 | let r = _mm256_maskz_packus_epi16(0, a, b); | 18197 | let r = _mm256_maskz_packus_epi16(0, a, b); |
| ... | @@ -18046,7 +18204,7 @@ mod tests { | ... | @@ -18046,7 +18204,7 @@ mod tests { |
| 18046 | } | 18204 | } |
| 18047 | 18205 | ||
| 18048 | #[simd_test(enable = "avx512bw,avx512vl")] | 18206 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 18049 | fn test_mm_mask_packus_epi16() { | 18207 | const fn test_mm_mask_packus_epi16() { |
| 18050 | let a = _mm_set1_epi16(-1); | 18208 | let a = _mm_set1_epi16(-1); |
| 18051 | let b = _mm_set1_epi16(1 << 8 | 1); | 18209 | let b = _mm_set1_epi16(1 << 8 | 1); |
| 18052 | let r = _mm_mask_packus_epi16(a, 0, a, b); | 18210 | let r = _mm_mask_packus_epi16(a, 0, a, b); |
| ... | @@ -18057,7 +18215,7 @@ mod tests { | ... | @@ -18057,7 +18215,7 @@ mod tests { |
| 18057 | } | 18215 | } |
| 18058 | 18216 | ||
| 18059 | #[simd_test(enable = "avx512bw,avx512vl")] | 18217 | #[simd_test(enable = "avx512bw,avx512vl")] |
| 18060 | fn test_mm_maskz_packus_epi16() { | 18218 | const fn test_mm_maskz_packus_epi16() { |
| 18061 | let a = _mm_set1_epi16(-1); | 18219 | let a = _mm_set1_epi16(-1); |
| 18062 | let b = _mm_set1_epi16(1); | 18220 | let b = _mm_set1_epi16(1); |
| 18063 | let r = _mm_maskz_packus_epi16(0, a, b); | 18221 | let r = _mm_maskz_packus_epi16(0, a, b); |
library/stdarch/crates/core_arch/src/x86/sse.rs+20-2| ... | @@ -2816,14 +2816,32 @@ mod tests { | ... | @@ -2816,14 +2816,32 @@ mod tests { |
| 2816 | let aa = &[3.0f32, 12.0, 23.0, NAN]; | 2816 | let aa = &[3.0f32, 12.0, 23.0, NAN]; |
| 2817 | let bb = &[3.0f32, 47.5, 1.5, NAN]; | 2817 | let bb = &[3.0f32, 47.5, 1.5, NAN]; |
| 2818 | 2818 | ||
| 2819 | let ee = &[1i32, 0, 1, 0]; | 2819 | let ee = &[0i32, 0, 1, 0]; |
| 2820 | 2820 | ||
| 2821 | for i in 0..4 { | 2821 | for i in 0..4 { |
| 2822 | let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0); | 2822 | let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0); |
| 2823 | let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0); | 2823 | let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0); |
| 2824 | 2824 | ||
| 2825 | let r = _mm_comige_ss(a, b); | 2825 | let r = _mm_comigt_ss(a, b); |
| 2826 | 2826 | ||
| 2827 | assert_eq!( | ||
| 2828 | ee[i], r, | ||
| 2829 | "_mm_comigt_ss({:?}, {:?}) = {}, expected: {} (i={})", | ||
| 2830 | a, b, r, ee[i], i | ||
| 2831 | ); | ||
| 2832 | } | ||
| 2833 | } | ||
| 2834 | |||
| 2835 | #[simd_test(enable = "sse")] | ||
| 2836 | fn test_mm_comige_ss() { | ||
| 2837 | let aa = &[3.0f32, 23.0, 12.0, NAN]; | ||
| 2838 | let bb = &[3.0f32, 1.5, 47.5, NAN]; | ||
| 2839 | let ee = &[1i32, 1, 0, 0]; | ||
| 2840 | |||
| 2841 | for i in 0..4 { | ||
| 2842 | let a = _mm_setr_ps(aa[i], 1.0, 2.0, 3.0); | ||
| 2843 | let b = _mm_setr_ps(bb[i], 0.0, 2.0, 4.0); | ||
| 2844 | let r = _mm_comige_ss(a, b); | ||
| 2827 | assert_eq!( | 2845 | assert_eq!( |
| 2828 | ee[i], r, | 2846 | ee[i], r, |
| 2829 | "_mm_comige_ss({:?}, {:?}) = {}, expected: {} (i={})", | 2847 | "_mm_comige_ss({:?}, {:?}) = {}, expected: {} (i={})", |
library/stdarch/crates/core_arch/src/x86/sse2.rs+64-18| ... | @@ -1484,7 +1484,7 @@ pub const fn _mm_move_epi64(a: __m128i) -> __m128i { | ... | @@ -1484,7 +1484,7 @@ pub const fn _mm_move_epi64(a: __m128i) -> __m128i { |
| 1484 | } | 1484 | } |
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| 1487 | /// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers | 1487 | /// Converts packed signed 16-bit integers from `a` and `b` to packed 8-bit integers |
| 1488 | /// using signed saturation. | 1488 | /// using signed saturation. |
| 1489 | /// | 1489 | /// |
| 1490 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packs_epi16) | 1490 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packs_epi16) |
| ... | @@ -1492,11 +1492,29 @@ pub const fn _mm_move_epi64(a: __m128i) -> __m128i { | ... | @@ -1492,11 +1492,29 @@ pub const fn _mm_move_epi64(a: __m128i) -> __m128i { |
| 1492 | #[target_feature(enable = "sse2")] | 1492 | #[target_feature(enable = "sse2")] |
| 1493 | #[cfg_attr(test, assert_instr(packsswb))] | 1493 | #[cfg_attr(test, assert_instr(packsswb))] |
| 1494 | #[stable(feature = "simd_x86", since = "1.27.0")] | 1494 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 1495 | pub fn _mm_packs_epi16(a: __m128i, b: __m128i) -> __m128i { | 1495 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 1496 | unsafe { transmute(packsswb(a.as_i16x8(), b.as_i16x8())) } | 1496 | pub const fn _mm_packs_epi16(a: __m128i, b: __m128i) -> __m128i { |
| 1497 | unsafe { | ||
| 1498 | let max = simd_splat(i8::MAX as i16); | ||
| 1499 | let min = simd_splat(i8::MIN as i16); | ||
| 1500 | |||
| 1501 | let clamped_a = simd_imax(simd_imin(a.as_i16x8(), max), min) | ||
| 1502 | .as_m128i() | ||
| 1503 | .as_i8x16(); | ||
| 1504 | let clamped_b = simd_imax(simd_imin(b.as_i16x8(), max), min) | ||
| 1505 | .as_m128i() | ||
| 1506 | .as_i8x16(); | ||
| 1507 | |||
| 1508 | // Shuffle the low i8 of each i16 from two concatenated vectors into | ||
| 1509 | // the low bits of the result register. | ||
| 1510 | const IDXS: [u32; 16] = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]; | ||
| 1511 | let result: i8x16 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 1512 | |||
| 1513 | result.as_m128i() | ||
| 1514 | } | ||
| 1497 | } | 1515 | } |
| 1498 | 1516 | ||
| 1499 | /// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers | 1517 | /// Converts packed signed 32-bit integers from `a` and `b` to packed 16-bit integers |
| 1500 | /// using signed saturation. | 1518 | /// using signed saturation. |
| 1501 | /// | 1519 | /// |
| 1502 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packs_epi32) | 1520 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packs_epi32) |
| ... | @@ -1504,11 +1522,25 @@ pub fn _mm_packs_epi16(a: __m128i, b: __m128i) -> __m128i { | ... | @@ -1504,11 +1522,25 @@ pub fn _mm_packs_epi16(a: __m128i, b: __m128i) -> __m128i { |
| 1504 | #[target_feature(enable = "sse2")] | 1522 | #[target_feature(enable = "sse2")] |
| 1505 | #[cfg_attr(test, assert_instr(packssdw))] | 1523 | #[cfg_attr(test, assert_instr(packssdw))] |
| 1506 | #[stable(feature = "simd_x86", since = "1.27.0")] | 1524 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 1507 | pub fn _mm_packs_epi32(a: __m128i, b: __m128i) -> __m128i { | 1525 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 1508 | unsafe { transmute(packssdw(a.as_i32x4(), b.as_i32x4())) } | 1526 | pub const fn _mm_packs_epi32(a: __m128i, b: __m128i) -> __m128i { |
| 1527 | unsafe { | ||
| 1528 | let max = simd_splat(i16::MAX as i32); | ||
| 1529 | let min = simd_splat(i16::MIN as i32); | ||
| 1530 | |||
| 1531 | let clamped_a = simd_imax(simd_imin(a.as_i32x4(), max), min); | ||
| 1532 | let clamped_b = simd_imax(simd_imin(b.as_i32x4(), max), min); | ||
| 1533 | |||
| 1534 | let clamped_a: i16x4 = simd_cast(clamped_a); | ||
| 1535 | let clamped_b: i16x4 = simd_cast(clamped_b); | ||
| 1536 | |||
| 1537 | let a: i64 = transmute(clamped_a); | ||
| 1538 | let b: i64 = transmute(clamped_b); | ||
| 1539 | i64x2::new(a, b).as_m128i() | ||
| 1540 | } | ||
| 1509 | } | 1541 | } |
| 1510 | 1542 | ||
| 1511 | /// Converts packed 16-bit integers from `a` and `b` to packed 8-bit integers | 1543 | /// Converts packed signed 16-bit integers from `a` and `b` to packed 8-bit integers |
| 1512 | /// using unsigned saturation. | 1544 | /// using unsigned saturation. |
| 1513 | /// | 1545 | /// |
| 1514 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi16) | 1546 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi16) |
| ... | @@ -1516,8 +1548,28 @@ pub fn _mm_packs_epi32(a: __m128i, b: __m128i) -> __m128i { | ... | @@ -1516,8 +1548,28 @@ pub fn _mm_packs_epi32(a: __m128i, b: __m128i) -> __m128i { |
| 1516 | #[target_feature(enable = "sse2")] | 1548 | #[target_feature(enable = "sse2")] |
| 1517 | #[cfg_attr(test, assert_instr(packuswb))] | 1549 | #[cfg_attr(test, assert_instr(packuswb))] |
| 1518 | #[stable(feature = "simd_x86", since = "1.27.0")] | 1550 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 1519 | pub fn _mm_packus_epi16(a: __m128i, b: __m128i) -> __m128i { | 1551 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 1520 | unsafe { transmute(packuswb(a.as_i16x8(), b.as_i16x8())) } | 1552 | pub const fn _mm_packus_epi16(a: __m128i, b: __m128i) -> __m128i { |
| 1553 | unsafe { | ||
| 1554 | let max = simd_splat(u8::MAX as i16); | ||
| 1555 | let min = simd_splat(u8::MIN as i16); | ||
| 1556 | |||
| 1557 | let clamped_a = simd_imax(simd_imin(a.as_i16x8(), max), min) | ||
| 1558 | .as_m128i() | ||
| 1559 | .as_i8x16(); | ||
| 1560 | let clamped_b = simd_imax(simd_imin(b.as_i16x8(), max), min) | ||
| 1561 | .as_m128i() | ||
| 1562 | .as_i8x16(); | ||
| 1563 | |||
| 1564 | // Shuffle the low bytes of each i16 from two concatenated vectors into | ||
| 1565 | // the low bits of the result register. | ||
| 1566 | // Without `simd_shuffle`, this intrinsic will cause the AVX-512BW | ||
| 1567 | // `_mm_mask_packus_epi16` and `_mm_maskz_packus_epi16` tests to fail. | ||
| 1568 | const IDXS: [u32; 16] = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]; | ||
| 1569 | let result: i8x16 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 1570 | |||
| 1571 | result.as_m128i() | ||
| 1572 | } | ||
| 1521 | } | 1573 | } |
| 1522 | 1574 | ||
| 1523 | /// Returns the `imm8` element of `a`. | 1575 | /// Returns the `imm8` element of `a`. |
| ... | @@ -3217,12 +3269,6 @@ unsafe extern "C" { | ... | @@ -3217,12 +3269,6 @@ unsafe extern "C" { |
| 3217 | fn cvtps2dq(a: __m128) -> i32x4; | 3269 | fn cvtps2dq(a: __m128) -> i32x4; |
| 3218 | #[link_name = "llvm.x86.sse2.maskmov.dqu"] | 3270 | #[link_name = "llvm.x86.sse2.maskmov.dqu"] |
| 3219 | fn maskmovdqu(a: i8x16, mask: i8x16, mem_addr: *mut i8); | 3271 | fn maskmovdqu(a: i8x16, mask: i8x16, mem_addr: *mut i8); |
| 3220 | #[link_name = "llvm.x86.sse2.packsswb.128"] | ||
| 3221 | fn packsswb(a: i16x8, b: i16x8) -> i8x16; | ||
| 3222 | #[link_name = "llvm.x86.sse2.packssdw.128"] | ||
| 3223 | fn packssdw(a: i32x4, b: i32x4) -> i16x8; | ||
| 3224 | #[link_name = "llvm.x86.sse2.packuswb.128"] | ||
| 3225 | fn packuswb(a: i16x8, b: i16x8) -> u8x16; | ||
| 3226 | #[link_name = "llvm.x86.sse2.max.sd"] | 3272 | #[link_name = "llvm.x86.sse2.max.sd"] |
| 3227 | fn maxsd(a: __m128d, b: __m128d) -> __m128d; | 3273 | fn maxsd(a: __m128d, b: __m128d) -> __m128d; |
| 3228 | #[link_name = "llvm.x86.sse2.max.pd"] | 3274 | #[link_name = "llvm.x86.sse2.max.pd"] |
| ... | @@ -4286,7 +4332,7 @@ mod tests { | ... | @@ -4286,7 +4332,7 @@ mod tests { |
| 4286 | } | 4332 | } |
| 4287 | 4333 | ||
| 4288 | #[simd_test(enable = "sse2")] | 4334 | #[simd_test(enable = "sse2")] |
| 4289 | fn test_mm_packs_epi16() { | 4335 | const fn test_mm_packs_epi16() { |
| 4290 | let a = _mm_setr_epi16(0x80, -0x81, 0, 0, 0, 0, 0, 0); | 4336 | let a = _mm_setr_epi16(0x80, -0x81, 0, 0, 0, 0, 0, 0); |
| 4291 | let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -0x81, 0x80); | 4337 | let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -0x81, 0x80); |
| 4292 | let r = _mm_packs_epi16(a, b); | 4338 | let r = _mm_packs_epi16(a, b); |
| ... | @@ -4300,7 +4346,7 @@ mod tests { | ... | @@ -4300,7 +4346,7 @@ mod tests { |
| 4300 | } | 4346 | } |
| 4301 | 4347 | ||
| 4302 | #[simd_test(enable = "sse2")] | 4348 | #[simd_test(enable = "sse2")] |
| 4303 | fn test_mm_packs_epi32() { | 4349 | const fn test_mm_packs_epi32() { |
| 4304 | let a = _mm_setr_epi32(0x8000, -0x8001, 0, 0); | 4350 | let a = _mm_setr_epi32(0x8000, -0x8001, 0, 0); |
| 4305 | let b = _mm_setr_epi32(0, 0, -0x8001, 0x8000); | 4351 | let b = _mm_setr_epi32(0, 0, -0x8001, 0x8000); |
| 4306 | let r = _mm_packs_epi32(a, b); | 4352 | let r = _mm_packs_epi32(a, b); |
| ... | @@ -4311,7 +4357,7 @@ mod tests { | ... | @@ -4311,7 +4357,7 @@ mod tests { |
| 4311 | } | 4357 | } |
| 4312 | 4358 | ||
| 4313 | #[simd_test(enable = "sse2")] | 4359 | #[simd_test(enable = "sse2")] |
| 4314 | fn test_mm_packus_epi16() { | 4360 | const fn test_mm_packus_epi16() { |
| 4315 | let a = _mm_setr_epi16(0x100, -1, 0, 0, 0, 0, 0, 0); | 4361 | let a = _mm_setr_epi16(0x100, -1, 0, 0, 0, 0, 0, 0); |
| 4316 | let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -1, 0x100); | 4362 | let b = _mm_setr_epi16(0, 0, 0, 0, 0, 0, -1, 0x100); |
| 4317 | let r = _mm_packus_epi16(a, b); | 4363 | let r = _mm_packus_epi16(a, b); |
library/stdarch/crates/core_arch/src/x86/sse41.rs+22-6| ... | @@ -418,7 +418,7 @@ pub const fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { | ... | @@ -418,7 +418,7 @@ pub const fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { |
| 418 | unsafe { simd_imin(a.as_u32x4(), b.as_u32x4()).as_m128i() } | 418 | unsafe { simd_imin(a.as_u32x4(), b.as_u32x4()).as_m128i() } |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | /// Converts packed 32-bit integers from `a` and `b` to packed 16-bit integers | 421 | /// Converts packed signed 32-bit integers from `a` and `b` to packed 16-bit integers |
| 422 | /// using unsigned saturation | 422 | /// using unsigned saturation |
| 423 | /// | 423 | /// |
| 424 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi32) | 424 | /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi32) |
| ... | @@ -426,8 +426,26 @@ pub const fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { | ... | @@ -426,8 +426,26 @@ pub const fn _mm_min_epu32(a: __m128i, b: __m128i) -> __m128i { |
| 426 | #[target_feature(enable = "sse4.1")] | 426 | #[target_feature(enable = "sse4.1")] |
| 427 | #[cfg_attr(test, assert_instr(packusdw))] | 427 | #[cfg_attr(test, assert_instr(packusdw))] |
| 428 | #[stable(feature = "simd_x86", since = "1.27.0")] | 428 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 429 | pub fn _mm_packus_epi32(a: __m128i, b: __m128i) -> __m128i { | 429 | #[rustc_const_unstable(feature = "stdarch_const_x86", issue = "149298")] |
| 430 | unsafe { transmute(packusdw(a.as_i32x4(), b.as_i32x4())) } | 430 | pub const fn _mm_packus_epi32(a: __m128i, b: __m128i) -> __m128i { |
| 431 | unsafe { | ||
| 432 | let max = simd_splat(u16::MAX as i32); | ||
| 433 | let min = simd_splat(u16::MIN as i32); | ||
| 434 | |||
| 435 | let clamped_a = simd_imax(simd_imin(a.as_i32x4(), max), min) | ||
| 436 | .as_m128i() | ||
| 437 | .as_i16x8(); | ||
| 438 | let clamped_b = simd_imax(simd_imin(b.as_i32x4(), max), min) | ||
| 439 | .as_m128i() | ||
| 440 | .as_i16x8(); | ||
| 441 | |||
| 442 | // Shuffle the low u16 of each i32 from two concatenated vectors into | ||
| 443 | // the low bits of the result register. | ||
| 444 | const IDXS: [u32; 8] = [0, 2, 4, 6, 8, 10, 12, 14]; | ||
| 445 | let result: i16x8 = simd_shuffle!(clamped_a, clamped_b, IDXS); | ||
| 446 | |||
| 447 | result.as_m128i() | ||
| 448 | } | ||
| 431 | } | 449 | } |
| 432 | 450 | ||
| 433 | /// Compares packed 64-bit integers in `a` and `b` for equality | 451 | /// Compares packed 64-bit integers in `a` and `b` for equality |
| ... | @@ -1166,8 +1184,6 @@ pub unsafe fn _mm_stream_load_si128(mem_addr: *const __m128i) -> __m128i { | ... | @@ -1166,8 +1184,6 @@ pub unsafe fn _mm_stream_load_si128(mem_addr: *const __m128i) -> __m128i { |
| 1166 | unsafe extern "C" { | 1184 | unsafe extern "C" { |
| 1167 | #[link_name = "llvm.x86.sse41.insertps"] | 1185 | #[link_name = "llvm.x86.sse41.insertps"] |
| 1168 | fn insertps(a: __m128, b: __m128, imm8: u8) -> __m128; | 1186 | fn insertps(a: __m128, b: __m128, imm8: u8) -> __m128; |
| 1169 | #[link_name = "llvm.x86.sse41.packusdw"] | ||
| 1170 | fn packusdw(a: i32x4, b: i32x4) -> u16x8; | ||
| 1171 | #[link_name = "llvm.x86.sse41.dppd"] | 1187 | #[link_name = "llvm.x86.sse41.dppd"] |
| 1172 | fn dppd(a: __m128d, b: __m128d, imm8: u8) -> __m128d; | 1188 | fn dppd(a: __m128d, b: __m128d, imm8: u8) -> __m128d; |
| 1173 | #[link_name = "llvm.x86.sse41.dpps"] | 1189 | #[link_name = "llvm.x86.sse41.dpps"] |
| ... | @@ -1455,7 +1471,7 @@ mod tests { | ... | @@ -1455,7 +1471,7 @@ mod tests { |
| 1455 | } | 1471 | } |
| 1456 | 1472 | ||
| 1457 | #[simd_test(enable = "sse4.1")] | 1473 | #[simd_test(enable = "sse4.1")] |
| 1458 | fn test_mm_packus_epi32() { | 1474 | const fn test_mm_packus_epi32() { |
| 1459 | let a = _mm_setr_epi32(1, 2, 3, 4); | 1475 | let a = _mm_setr_epi32(1, 2, 3, 4); |
| 1460 | let b = _mm_setr_epi32(-1, -2, -3, -4); | 1476 | let b = _mm_setr_epi32(-1, -2, -3, -4); |
| 1461 | let r = _mm_packus_epi32(a, b); | 1477 | let r = _mm_packus_epi32(a, b); |
library/stdarch/crates/stdarch-gen-arm/spec/neon/aarch64.spec.yml+70-130| ... | @@ -4567,20 +4567,11 @@ intrinsics: | ... | @@ -4567,20 +4567,11 @@ intrinsics: |
| 4567 | unsafe: [neon] | 4567 | unsafe: [neon] |
| 4568 | attr: | 4568 | attr: |
| 4569 | - *neon-stable | 4569 | - *neon-stable |
| 4570 | assert_instr: [st1] | 4570 | assert_instr: [stp] |
| 4571 | types: | 4571 | types: |
| 4572 | - ['f64', float64x1x2_t, float64x1_t] | 4572 | - ['f64', float64x1x2_t] |
| 4573 | compose: | 4573 | compose: |
| 4574 | - LLVMLink: | 4574 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 4575 | name: 'st2.{neon_type[1]}' | ||
| 4576 | arguments: | ||
| 4577 | - 'a: {type[2]}' | ||
| 4578 | - 'b: {type[2]}' | ||
| 4579 | - 'ptr: *mut i8' | ||
| 4580 | links: | ||
| 4581 | - link: 'llvm.aarch64.neon.st2.v{neon_type[1].lane}{type[0]}.p0' | ||
| 4582 | arch: aarch64,arm64ec | ||
| 4583 | - FnCall: ['_vst2{neon_type[1].nox}', ['b.0', 'b.1', 'a as _']] | ||
| 4584 | 4575 | ||
| 4585 | - name: "vst2{neon_type[1].nox}" | 4576 | - name: "vst2{neon_type[1].nox}" |
| 4586 | doc: "Store multiple 2-element structures from two registers" | 4577 | doc: "Store multiple 2-element structures from two registers" |
| ... | @@ -4591,19 +4582,10 @@ intrinsics: | ... | @@ -4591,19 +4582,10 @@ intrinsics: |
| 4591 | - *neon-stable | 4582 | - *neon-stable |
| 4592 | assert_instr: [st2] | 4583 | assert_instr: [st2] |
| 4593 | types: | 4584 | types: |
| 4594 | - [i64, int64x2x2_t, int64x2_t] | 4585 | - [i64, int64x2x2_t, "2"] |
| 4595 | - [f64, float64x2x2_t, float64x2_t] | 4586 | - [f64, float64x2x2_t, "2"] |
| 4596 | compose: | 4587 | compose: |
| 4597 | - LLVMLink: | 4588 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "2", a, b], [], true] |
| 4598 | name: 'st2.{neon_type[1]}' | ||
| 4599 | arguments: | ||
| 4600 | - 'a: {type[2]}' | ||
| 4601 | - 'b: {type[2]}' | ||
| 4602 | - 'ptr: *mut i8' | ||
| 4603 | links: | ||
| 4604 | - link: 'llvm.aarch64.neon.st2.v{neon_type[1].lane}{type[0]}.p0' | ||
| 4605 | arch: aarch64,arm64ec | ||
| 4606 | - FnCall: ['_vst2{neon_type[1].nox}', ['b.0', 'b.1', 'a as _']] | ||
| 4607 | 4589 | ||
| 4608 | - name: "vst2{neon_type[1].lane_nox}" | 4590 | - name: "vst2{neon_type[1].lane_nox}" |
| 4609 | doc: "Store multiple 2-element structures from two registers" | 4591 | doc: "Store multiple 2-element structures from two registers" |
| ... | @@ -4781,19 +4763,9 @@ intrinsics: | ... | @@ -4781,19 +4763,9 @@ intrinsics: |
| 4781 | safety: | 4763 | safety: |
| 4782 | unsafe: [neon] | 4764 | unsafe: [neon] |
| 4783 | types: | 4765 | types: |
| 4784 | - [f64, float64x1x3_t, float64x1_t] | 4766 | - [f64, float64x1x3_t] |
| 4785 | compose: | 4767 | compose: |
| 4786 | - LLVMLink: | 4768 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 4787 | name: 'st3.{neon_type[1].nox}' | ||
| 4788 | arguments: | ||
| 4789 | - 'a: {type[2]}' | ||
| 4790 | - 'b: {type[2]}' | ||
| 4791 | - 'c: {type[2]}' | ||
| 4792 | - 'ptr: *mut i8' | ||
| 4793 | links: | ||
| 4794 | - link: 'llvm.aarch64.neon.st3.v{neon_type[1].lane}{type[0]}.p0' | ||
| 4795 | arch: aarch64,arm64ec | ||
| 4796 | - FnCall: ['_vst3{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'a as _']] | ||
| 4797 | 4769 | ||
| 4798 | - name: "vst3{neon_type[1].lane_nox}" | 4770 | - name: "vst3{neon_type[1].lane_nox}" |
| 4799 | doc: "Store multiple 3-element structures from three registers" | 4771 | doc: "Store multiple 3-element structures from three registers" |
| ... | @@ -4860,20 +4832,10 @@ intrinsics: | ... | @@ -4860,20 +4832,10 @@ intrinsics: |
| 4860 | safety: | 4832 | safety: |
| 4861 | unsafe: [neon] | 4833 | unsafe: [neon] |
| 4862 | types: | 4834 | types: |
| 4863 | - [i64, int64x2x3_t, int64x2_t] | 4835 | - [i64, int64x2x3_t, "2"] |
| 4864 | - [f64, float64x2x3_t, float64x2_t] | 4836 | - [f64, float64x2x3_t, "2"] |
| 4865 | compose: | 4837 | compose: |
| 4866 | - LLVMLink: | 4838 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "3", a, b], [], true] |
| 4867 | name: 'st3.{neon_type[1].nox}' | ||
| 4868 | arguments: | ||
| 4869 | - 'a: {type[2]}' | ||
| 4870 | - 'b: {type[2]}' | ||
| 4871 | - 'c: {type[2]}' | ||
| 4872 | - 'ptr: *mut i8' | ||
| 4873 | links: | ||
| 4874 | - link: 'llvm.aarch64.neon.st3.v{neon_type[1].lane}{type[0]}.p0' | ||
| 4875 | arch: aarch64,arm64ec | ||
| 4876 | - FnCall: ['_vst3{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'a as _']] | ||
| 4877 | 4839 | ||
| 4878 | - name: "vst3{neon_type[1].nox}" | 4840 | - name: "vst3{neon_type[1].nox}" |
| 4879 | doc: "Store multiple 3-element structures from three registers" | 4841 | doc: "Store multiple 3-element structures from three registers" |
| ... | @@ -4995,20 +4957,9 @@ intrinsics: | ... | @@ -4995,20 +4957,9 @@ intrinsics: |
| 4995 | safety: | 4957 | safety: |
| 4996 | unsafe: [neon] | 4958 | unsafe: [neon] |
| 4997 | types: | 4959 | types: |
| 4998 | - [f64, float64x1x4_t, float64x1_t] | 4960 | - [f64, float64x1x4_t] |
| 4999 | compose: | 4961 | compose: |
| 5000 | - LLVMLink: | 4962 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5001 | name: 'st4.{neon_type[1].nox}' | ||
| 5002 | arguments: | ||
| 5003 | - 'a: {type[2]}' | ||
| 5004 | - 'b: {type[2]}' | ||
| 5005 | - 'c: {type[2]}' | ||
| 5006 | - 'd: {type[2]}' | ||
| 5007 | - 'ptr: *mut i8' | ||
| 5008 | links: | ||
| 5009 | - link: 'llvm.aarch64.neon.st4.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5010 | arch: aarch64,arm64ec | ||
| 5011 | - FnCall: ['_vst4{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'b.3', 'a as _']] | ||
| 5012 | 4963 | ||
| 5013 | - name: "vst4{neon_type[1].lane_nox}" | 4964 | - name: "vst4{neon_type[1].lane_nox}" |
| 5014 | doc: "Store multiple 4-element structures from four registers" | 4965 | doc: "Store multiple 4-element structures from four registers" |
| ... | @@ -5075,21 +5026,10 @@ intrinsics: | ... | @@ -5075,21 +5026,10 @@ intrinsics: |
| 5075 | safety: | 5026 | safety: |
| 5076 | unsafe: [neon] | 5027 | unsafe: [neon] |
| 5077 | types: | 5028 | types: |
| 5078 | - [i64, int64x2x4_t, int64x2_t] | 5029 | - [i64, int64x2x4_t, "2"] |
| 5079 | - [f64, float64x2x4_t, float64x2_t] | 5030 | - [f64, float64x2x4_t, "2"] |
| 5080 | compose: | 5031 | compose: |
| 5081 | - LLVMLink: | 5032 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "4", a, b], [], true] |
| 5082 | name: 'st4.{neon_type[1].nox}' | ||
| 5083 | arguments: | ||
| 5084 | - 'a: {type[2]}' | ||
| 5085 | - 'b: {type[2]}' | ||
| 5086 | - 'c: {type[2]}' | ||
| 5087 | - 'd: {type[2]}' | ||
| 5088 | - 'ptr: *mut i8' | ||
| 5089 | links: | ||
| 5090 | - link: 'llvm.aarch64.neon.st4.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5091 | arch: aarch64,arm64ec | ||
| 5092 | - FnCall: ['_vst4{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'b.3', 'a as _']] | ||
| 5093 | 5033 | ||
| 5094 | - name: "vst4{neon_type[1].nox}" | 5034 | - name: "vst4{neon_type[1].nox}" |
| 5095 | doc: "Store multiple 4-element structures from four registers" | 5035 | doc: "Store multiple 4-element structures from four registers" |
| ... | @@ -5434,7 +5374,7 @@ intrinsics: | ... | @@ -5434,7 +5374,7 @@ intrinsics: |
| 5434 | static_defs: ["const LANE: i32"] | 5374 | static_defs: ["const LANE: i32"] |
| 5435 | safety: safe | 5375 | safety: safe |
| 5436 | types: | 5376 | types: |
| 5437 | - ["q_lane_f64", float64x2_t, float64x1_t, "q_f64", '[LANE as u32, LANE as u32]'] | 5377 | - ["q_lane_f64", float64x2_t, float64x1_t, "q_f64", '[LANE as u32; 2]'] |
| 5438 | compose: | 5378 | compose: |
| 5439 | - FnCall: [static_assert!, ['LANE == 0']] | 5379 | - FnCall: [static_assert!, ['LANE == 0']] |
| 5440 | - FnCall: | 5380 | - FnCall: |
| ... | @@ -5503,11 +5443,11 @@ intrinsics: | ... | @@ -5503,11 +5443,11 @@ intrinsics: |
| 5503 | static_defs: ["const LANE: i32"] | 5443 | static_defs: ["const LANE: i32"] |
| 5504 | safety: safe | 5444 | safety: safe |
| 5505 | types: | 5445 | types: |
| 5506 | - ['_lane_f32', float32x2_t, float32x2_t, '1', '_f32', '[LANE as u32, LANE as u32]'] | 5446 | - ['_lane_f32', float32x2_t, float32x2_t, '1', '_f32', '[LANE as u32; 2]'] |
| 5507 | - ['_laneq_f32', float32x2_t, float32x4_t, '2', '_f32', '[LANE as u32, LANE as u32]'] | 5447 | - ['_laneq_f32', float32x2_t, float32x4_t, '2', '_f32', '[LANE as u32; 2]'] |
| 5508 | - ['q_lane_f32', float32x4_t, float32x2_t, '1', 'q_f32', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5448 | - ['q_lane_f32', float32x4_t, float32x2_t, '1', 'q_f32', '[LANE as u32; 4]'] |
| 5509 | - ['q_laneq_f32', float32x4_t, float32x4_t, '2', 'q_f32', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5449 | - ['q_laneq_f32', float32x4_t, float32x4_t, '2', 'q_f32', '[LANE as u32; 4]'] |
| 5510 | - ['q_laneq_f64', float64x2_t, float64x2_t, '1', 'q_f64', '[LANE as u32, LANE as u32]'] | 5450 | - ['q_laneq_f64', float64x2_t, float64x2_t, '1', 'q_f64', '[LANE as u32; 2]'] |
| 5511 | compose: | 5451 | compose: |
| 5512 | - FnCall: [static_assert_uimm_bits!, ['LANE', "{type[3]}"]] | 5452 | - FnCall: [static_assert_uimm_bits!, ['LANE', "{type[3]}"]] |
| 5513 | - FnCall: | 5453 | - FnCall: |
| ... | @@ -5533,10 +5473,10 @@ intrinsics: | ... | @@ -5533,10 +5473,10 @@ intrinsics: |
| 5533 | static_defs: ["const LANE: i32"] | 5473 | static_defs: ["const LANE: i32"] |
| 5534 | safety: safe | 5474 | safety: safe |
| 5535 | types: | 5475 | types: |
| 5536 | - ['_lane_f16', float16x4_t, float16x4_t, '2', '_f16', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5476 | - ['_lane_f16', float16x4_t, float16x4_t, '2', '_f16', '[LANE as u32; 4]'] |
| 5537 | - ['_laneq_f16', float16x4_t, float16x8_t, '3', '_f16', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5477 | - ['_laneq_f16', float16x4_t, float16x8_t, '3', '_f16', '[LANE as u32; 4]'] |
| 5538 | - ['q_lane_f16', float16x8_t, float16x4_t, '2', 'q_f16', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5478 | - ['q_lane_f16', float16x8_t, float16x4_t, '2', 'q_f16', '[LANE as u32; 8]'] |
| 5539 | - ['q_laneq_f16', float16x8_t, float16x8_t, '3', 'q_f16', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 5479 | - ['q_laneq_f16', float16x8_t, float16x8_t, '3', 'q_f16', '[LANE as u32; 8]'] |
| 5540 | compose: | 5480 | compose: |
| 5541 | - FnCall: [static_assert_uimm_bits!, ['LANE', "{type[3]}"]] | 5481 | - FnCall: [static_assert_uimm_bits!, ['LANE', "{type[3]}"]] |
| 5542 | - FnCall: | 5482 | - FnCall: |
| ... | @@ -7815,14 +7755,14 @@ intrinsics: | ... | @@ -7815,14 +7755,14 @@ intrinsics: |
| 7815 | static_defs: ['const LANE: i32'] | 7755 | static_defs: ['const LANE: i32'] |
| 7816 | safety: safe | 7756 | safety: safe |
| 7817 | types: | 7757 | types: |
| 7818 | - [_lane_s16, int16x4_t, int16x4_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7758 | - [_lane_s16, int16x4_t, int16x4_t, int16x4_t, '2', '[LANE as u32; 4]'] |
| 7819 | - [_laneq_s16, int16x4_t, int16x4_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7759 | - [_laneq_s16, int16x4_t, int16x4_t, int16x8_t, '3', '[LANE as u32; 4]'] |
| 7820 | - [q_lane_s16, int16x8_t, int16x8_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7760 | - [q_lane_s16, int16x8_t, int16x8_t, int16x4_t, '2', '[LANE as u32; 8]'] |
| 7821 | - [q_laneq_s16, int16x8_t, int16x8_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7761 | - [q_laneq_s16, int16x8_t, int16x8_t, int16x8_t, '3', '[LANE as u32; 8]'] |
| 7822 | - [_lane_s32, int32x2_t, int32x2_t, int32x2_t, '1', '[LANE as u32, LANE as u32]'] | 7762 | - [_lane_s32, int32x2_t, int32x2_t, int32x2_t, '1', '[LANE as u32; 2]'] |
| 7823 | - [_laneq_s32, int32x2_t, int32x2_t, int32x4_t, '2', '[LANE as u32, LANE as u32]'] | 7763 | - [_laneq_s32, int32x2_t, int32x2_t, int32x4_t, '2', '[LANE as u32; 2]'] |
| 7824 | - [q_lane_s32, int32x4_t, int32x4_t, int32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7764 | - [q_lane_s32, int32x4_t, int32x4_t, int32x2_t, '1', '[LANE as u32; 4]'] |
| 7825 | - [q_laneq_s32, int32x4_t, int32x4_t, int32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7765 | - [q_laneq_s32, int32x4_t, int32x4_t, int32x4_t, '2', '[LANE as u32; 4]'] |
| 7826 | compose: | 7766 | compose: |
| 7827 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[4]}']] | 7767 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[4]}']] |
| 7828 | - Let: [c, "{type[1]}", {FnCall: [simd_shuffle!, [c, c, "{type[5]}"]]}] | 7768 | - Let: [c, "{type[1]}", {FnCall: [simd_shuffle!, [c, c, "{type[5]}"]]}] |
| ... | @@ -7899,14 +7839,14 @@ intrinsics: | ... | @@ -7899,14 +7839,14 @@ intrinsics: |
| 7899 | static_defs: ['const LANE: i32'] | 7839 | static_defs: ['const LANE: i32'] |
| 7900 | safety: safe | 7840 | safety: safe |
| 7901 | types: | 7841 | types: |
| 7902 | - [_lane_s16, int16x4_t, int16x4_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7842 | - [_lane_s16, int16x4_t, int16x4_t, int16x4_t, '2', '[LANE as u32; 4]'] |
| 7903 | - [_laneq_s16, int16x4_t, int16x4_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7843 | - [_laneq_s16, int16x4_t, int16x4_t, int16x8_t, '3', '[LANE as u32; 4]'] |
| 7904 | - [q_lane_s16, int16x8_t, int16x8_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7844 | - [q_lane_s16, int16x8_t, int16x8_t, int16x4_t, '2', '[LANE as u32; 8]'] |
| 7905 | - [q_laneq_s16, int16x8_t, int16x8_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7845 | - [q_laneq_s16, int16x8_t, int16x8_t, int16x8_t, '3', '[LANE as u32; 8]'] |
| 7906 | - [_lane_s32, int32x2_t, int32x2_t, int32x2_t, '1', '[LANE as u32, LANE as u32]'] | 7846 | - [_lane_s32, int32x2_t, int32x2_t, int32x2_t, '1', '[LANE as u32; 2]'] |
| 7907 | - [_laneq_s32, int32x2_t, int32x2_t, int32x4_t, '2', '[LANE as u32, LANE as u32]'] | 7847 | - [_laneq_s32, int32x2_t, int32x2_t, int32x4_t, '2', '[LANE as u32; 2]'] |
| 7908 | - [q_lane_s32, int32x4_t, int32x4_t, int32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7848 | - [q_lane_s32, int32x4_t, int32x4_t, int32x2_t, '1', '[LANE as u32; 4]'] |
| 7909 | - [q_laneq_s32, int32x4_t, int32x4_t, int32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 7849 | - [q_laneq_s32, int32x4_t, int32x4_t, int32x4_t, '2', '[LANE as u32; 4]'] |
| 7910 | compose: | 7850 | compose: |
| 7911 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[4]}']] | 7851 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[4]}']] |
| 7912 | - Let: [c, "{type[1]}", {FnCall: [simd_shuffle!, [c, c, "{type[5]}"]]}] | 7852 | - Let: [c, "{type[1]}", {FnCall: [simd_shuffle!, [c, c, "{type[5]}"]]}] |
| ... | @@ -11198,7 +11138,7 @@ intrinsics: | ... | @@ -11198,7 +11138,7 @@ intrinsics: |
| 11198 | - FnCall: | 11138 | - FnCall: |
| 11199 | - simd_mul | 11139 | - simd_mul |
| 11200 | - - a | 11140 | - - a |
| 11201 | - FnCall: ["simd_shuffle!", [b, b, '[LANE as u32, LANE as u32]']] | 11141 | - FnCall: ["simd_shuffle!", [b, b, '[LANE as u32; 2]']] |
| 11202 | 11142 | ||
| 11203 | - name: "vmuld_lane_f64" | 11143 | - name: "vmuld_lane_f64" |
| 11204 | doc: "Floating-point multiply" | 11144 | doc: "Floating-point multiply" |
| ... | @@ -11255,7 +11195,7 @@ intrinsics: | ... | @@ -11255,7 +11195,7 @@ intrinsics: |
| 11255 | - FnCall: | 11195 | - FnCall: |
| 11256 | - simd_mul | 11196 | - simd_mul |
| 11257 | - - a | 11197 | - - a |
| 11258 | - FnCall: [simd_shuffle!, [b, b, '[LANE as u32, LANE as u32]']] | 11198 | - FnCall: [simd_shuffle!, [b, b, '[LANE as u32; 2]']] |
| 11259 | 11199 | ||
| 11260 | 11200 | ||
| 11261 | # vmulq_laneq_f16 | 11201 | # vmulq_laneq_f16 |
| ... | @@ -11272,8 +11212,8 @@ intrinsics: | ... | @@ -11272,8 +11212,8 @@ intrinsics: |
| 11272 | static_defs: ['const LANE: i32'] | 11212 | static_defs: ['const LANE: i32'] |
| 11273 | safety: safe | 11213 | safety: safe |
| 11274 | types: | 11214 | types: |
| 11275 | - [float16x4_t, float16x8_t, '_lane', "[LANE as u32, LANE as u32, LANE as u32, LANE as u32]"] | 11215 | - [float16x4_t, float16x8_t, '_lane', "[LANE as u32; 4]"] |
| 11276 | - [float16x8_t, float16x8_t, 'q_lane', "[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]"] | 11216 | - [float16x8_t, float16x8_t, 'q_lane', "[LANE as u32; 8]"] |
| 11277 | compose: | 11217 | compose: |
| 11278 | - FnCall: [static_assert_uimm_bits!, [LANE, '3']] | 11218 | - FnCall: [static_assert_uimm_bits!, [LANE, '3']] |
| 11279 | - FnCall: | 11219 | - FnCall: |
| ... | @@ -11395,10 +11335,10 @@ intrinsics: | ... | @@ -11395,10 +11335,10 @@ intrinsics: |
| 11395 | static_defs: ['const LANE: i32'] | 11335 | static_defs: ['const LANE: i32'] |
| 11396 | safety: safe | 11336 | safety: safe |
| 11397 | types: | 11337 | types: |
| 11398 | - [int32x4_t, int16x8_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11338 | - [int32x4_t, int16x8_t, int16x4_t, '2', '[LANE as u32; 8]'] |
| 11399 | - [int32x4_t, int16x8_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11339 | - [int32x4_t, int16x8_t, int16x8_t, '3', '[LANE as u32; 8]'] |
| 11400 | - [int64x2_t, int32x4_t, int32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11340 | - [int64x2_t, int32x4_t, int32x2_t, '1', '[LANE as u32; 4]'] |
| 11401 | - [int64x2_t, int32x4_t, int32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11341 | - [int64x2_t, int32x4_t, int32x4_t, '2', '[LANE as u32; 4]'] |
| 11402 | compose: | 11342 | compose: |
| 11403 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] | 11343 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] |
| 11404 | - FnCall: | 11344 | - FnCall: |
| ... | @@ -11418,10 +11358,10 @@ intrinsics: | ... | @@ -11418,10 +11358,10 @@ intrinsics: |
| 11418 | static_defs: ['const LANE: i32'] | 11358 | static_defs: ['const LANE: i32'] |
| 11419 | safety: safe | 11359 | safety: safe |
| 11420 | types: | 11360 | types: |
| 11421 | - [uint32x4_t, uint16x8_t, uint16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11361 | - [uint32x4_t, uint16x8_t, uint16x4_t, '2', '[LANE as u32; 8]'] |
| 11422 | - [uint32x4_t, uint16x8_t, uint16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11362 | - [uint32x4_t, uint16x8_t, uint16x8_t, '3', '[LANE as u32; 8]'] |
| 11423 | - [uint64x2_t, uint32x4_t, uint32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11363 | - [uint64x2_t, uint32x4_t, uint32x2_t, '1', '[LANE as u32; 4]'] |
| 11424 | - [uint64x2_t, uint32x4_t, uint32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11364 | - [uint64x2_t, uint32x4_t, uint32x4_t, '2', '[LANE as u32; 4]'] |
| 11425 | compose: | 11365 | compose: |
| 11426 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] | 11366 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] |
| 11427 | - FnCall: | 11367 | - FnCall: |
| ... | @@ -11720,10 +11660,10 @@ intrinsics: | ... | @@ -11720,10 +11660,10 @@ intrinsics: |
| 11720 | static_defs: ['const LANE: i32'] | 11660 | static_defs: ['const LANE: i32'] |
| 11721 | safety: safe | 11661 | safety: safe |
| 11722 | types: | 11662 | types: |
| 11723 | - [int16x8_t, int16x4_t, int32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11663 | - [int16x8_t, int16x4_t, int32x4_t, '2', '[LANE as u32; 8]'] |
| 11724 | - [int16x8_t, int16x8_t, int32x4_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11664 | - [int16x8_t, int16x8_t, int32x4_t, '3', '[LANE as u32; 8]'] |
| 11725 | - [int32x4_t, int32x2_t, int64x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11665 | - [int32x4_t, int32x2_t, int64x2_t, '1', '[LANE as u32; 4]'] |
| 11726 | - [int32x4_t, int32x4_t, int64x2_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11666 | - [int32x4_t, int32x4_t, int64x2_t, '2', '[LANE as u32; 4]'] |
| 11727 | compose: | 11667 | compose: |
| 11728 | - FnCall: [static_assert_uimm_bits!, [LANE, "{type[3]}"]] | 11668 | - FnCall: [static_assert_uimm_bits!, [LANE, "{type[3]}"]] |
| 11729 | - FnCall: | 11669 | - FnCall: |
| ... | @@ -11742,10 +11682,10 @@ intrinsics: | ... | @@ -11742,10 +11682,10 @@ intrinsics: |
| 11742 | static_defs: ['const LANE: i32'] | 11682 | static_defs: ['const LANE: i32'] |
| 11743 | safety: safe | 11683 | safety: safe |
| 11744 | types: | 11684 | types: |
| 11745 | - [uint16x8_t, uint16x4_t, uint32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11685 | - [uint16x8_t, uint16x4_t, uint32x4_t, '2', '[LANE as u32; 8]'] |
| 11746 | - [uint16x8_t, uint16x8_t, uint32x4_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11686 | - [uint16x8_t, uint16x8_t, uint32x4_t, '3', '[LANE as u32; 8]'] |
| 11747 | - [uint32x4_t, uint32x2_t, uint64x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11687 | - [uint32x4_t, uint32x2_t, uint64x2_t, '1', '[LANE as u32; 4]'] |
| 11748 | - [uint32x4_t, uint32x4_t, uint64x2_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11688 | - [uint32x4_t, uint32x4_t, uint64x2_t, '2', '[LANE as u32; 4]'] |
| 11749 | compose: | 11689 | compose: |
| 11750 | - FnCall: [static_assert_uimm_bits!, [LANE, "{type[3]}"]] | 11690 | - FnCall: [static_assert_uimm_bits!, [LANE, "{type[3]}"]] |
| 11751 | - FnCall: | 11691 | - FnCall: |
| ... | @@ -12033,10 +11973,10 @@ intrinsics: | ... | @@ -12033,10 +11973,10 @@ intrinsics: |
| 12033 | static_defs: ['const LANE: i32'] | 11973 | static_defs: ['const LANE: i32'] |
| 12034 | safety: safe | 11974 | safety: safe |
| 12035 | types: | 11975 | types: |
| 12036 | - [int32x4_t, int16x8_t, int16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11976 | - [int32x4_t, int16x8_t, int16x4_t, '2', '[LANE as u32; 8]'] |
| 12037 | - [int32x4_t, int16x8_t, int16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11977 | - [int32x4_t, int16x8_t, int16x8_t, '3', '[LANE as u32; 8]'] |
| 12038 | - [int64x2_t, int32x4_t, int32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11978 | - [int64x2_t, int32x4_t, int32x2_t, '1', '[LANE as u32; 4]'] |
| 12039 | - [int64x2_t, int32x4_t, int32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11979 | - [int64x2_t, int32x4_t, int32x4_t, '2', '[LANE as u32; 4]'] |
| 12040 | compose: | 11980 | compose: |
| 12041 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] | 11981 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] |
| 12042 | - FnCall: ['vmlal_high_{neon_type[2]}', [a, b, {FnCall: [simd_shuffle!, [c, c, '{type[4]}']]}]] | 11982 | - FnCall: ['vmlal_high_{neon_type[2]}', [a, b, {FnCall: [simd_shuffle!, [c, c, '{type[4]}']]}]] |
| ... | @@ -12052,10 +11992,10 @@ intrinsics: | ... | @@ -12052,10 +11992,10 @@ intrinsics: |
| 12052 | static_defs: ['const LANE: i32'] | 11992 | static_defs: ['const LANE: i32'] |
| 12053 | safety: safe | 11993 | safety: safe |
| 12054 | types: | 11994 | types: |
| 12055 | - [uint32x4_t, uint16x8_t, uint16x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11995 | - [uint32x4_t, uint16x8_t, uint16x4_t, '2', '[LANE as u32; 8]'] |
| 12056 | - [uint32x4_t, uint16x8_t, uint16x8_t, '3', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11996 | - [uint32x4_t, uint16x8_t, uint16x8_t, '3', '[LANE as u32; 8]'] |
| 12057 | - [uint64x2_t, uint32x4_t, uint32x2_t, '1', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11997 | - [uint64x2_t, uint32x4_t, uint32x2_t, '1', '[LANE as u32; 4]'] |
| 12058 | - [uint64x2_t, uint32x4_t, uint32x4_t, '2', '[LANE as u32, LANE as u32, LANE as u32, LANE as u32]'] | 11998 | - [uint64x2_t, uint32x4_t, uint32x4_t, '2', '[LANE as u32; 4]'] |
| 12059 | compose: | 11999 | compose: |
| 12060 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] | 12000 | - FnCall: [static_assert_uimm_bits!, [LANE, '{type[3]}']] |
| 12061 | - FnCall: ['vmlal_high_{neon_type[2]}', [a, b, {FnCall: [simd_shuffle!, [c, c, '{type[4]}']]}]] | 12001 | - FnCall: ['vmlal_high_{neon_type[2]}', [a, b, {FnCall: [simd_shuffle!, [c, c, '{type[4]}']]}]] |
library/stdarch/crates/stdarch-gen-arm/spec/neon/arm_shared.spec.yml+69-164| ... | @@ -1439,12 +1439,12 @@ intrinsics: | ... | @@ -1439,12 +1439,12 @@ intrinsics: |
| 1439 | static_defs: ['const N: i32'] | 1439 | static_defs: ['const N: i32'] |
| 1440 | safety: safe | 1440 | safety: safe |
| 1441 | types: | 1441 | types: |
| 1442 | - [_lane_s8, int8x8_t, int8x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1442 | - [_lane_s8, int8x8_t, int8x8_t, '3', '[N as u32; 8]'] |
| 1443 | - [q_lane_s8, int8x8_t, int8x16_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1443 | - [q_lane_s8, int8x8_t, int8x16_t, '3', '[N as u32; 16]'] |
| 1444 | - [_lane_u8, uint8x8_t, uint8x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1444 | - [_lane_u8, uint8x8_t, uint8x8_t, '3', '[N as u32; 8]'] |
| 1445 | - [q_lane_u8, uint8x8_t, uint8x16_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1445 | - [q_lane_u8, uint8x8_t, uint8x16_t, '3', '[N as u32; 16]'] |
| 1446 | - [_lane_p8, poly8x8_t, poly8x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1446 | - [_lane_p8, poly8x8_t, poly8x8_t, '3', '[N as u32; 8]'] |
| 1447 | - [q_lane_p8, poly8x8_t, poly8x16_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1447 | - [q_lane_p8, poly8x8_t, poly8x16_t, '3', '[N as u32; 16]'] |
| 1448 | compose: | 1448 | compose: |
| 1449 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1449 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1450 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1450 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -1463,12 +1463,12 @@ intrinsics: | ... | @@ -1463,12 +1463,12 @@ intrinsics: |
| 1463 | static_defs: ['const N: i32'] | 1463 | static_defs: ['const N: i32'] |
| 1464 | safety: safe | 1464 | safety: safe |
| 1465 | types: | 1465 | types: |
| 1466 | - [q_laneq_s8, int8x16_t, int8x16_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1466 | - [q_laneq_s8, int8x16_t, int8x16_t, '4', '[N as u32; 16]'] |
| 1467 | - [_laneq_s8, int8x16_t, int8x8_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1467 | - [_laneq_s8, int8x16_t, int8x8_t, '4', '[N as u32; 8]'] |
| 1468 | - [q_laneq_u8, uint8x16_t, uint8x16_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1468 | - [q_laneq_u8, uint8x16_t, uint8x16_t, '4', '[N as u32; 16]'] |
| 1469 | - [_laneq_u8, uint8x16_t, uint8x8_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1469 | - [_laneq_u8, uint8x16_t, uint8x8_t, '4', '[N as u32; 8]'] |
| 1470 | - [q_laneq_p8, poly8x16_t, poly8x16_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1470 | - [q_laneq_p8, poly8x16_t, poly8x16_t, '4', '[N as u32; 16]'] |
| 1471 | - [_laneq_p8, poly8x16_t, poly8x8_t, '4', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1471 | - [_laneq_p8, poly8x16_t, poly8x8_t, '4', '[N as u32; 8]'] |
| 1472 | compose: | 1472 | compose: |
| 1473 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1473 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1474 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1474 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -1487,12 +1487,12 @@ intrinsics: | ... | @@ -1487,12 +1487,12 @@ intrinsics: |
| 1487 | static_defs: ['const N: i32'] | 1487 | static_defs: ['const N: i32'] |
| 1488 | safety: safe | 1488 | safety: safe |
| 1489 | types: | 1489 | types: |
| 1490 | - [_lane_s16, int16x4_t, int16x4_t, '2', '[N as u32, N as u32, N as u32, N as u32]'] | 1490 | - [_lane_s16, int16x4_t, int16x4_t, '2', '[N as u32; 4]'] |
| 1491 | - [q_lane_s16, int16x4_t, int16x8_t, '2', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1491 | - [q_lane_s16, int16x4_t, int16x8_t, '2', '[N as u32; 8]'] |
| 1492 | - [_lane_u16, uint16x4_t, uint16x4_t, '2', '[N as u32, N as u32, N as u32, N as u32]'] | 1492 | - [_lane_u16, uint16x4_t, uint16x4_t, '2', '[N as u32; 4]'] |
| 1493 | - [q_lane_u16, uint16x4_t, uint16x8_t, '2', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1493 | - [q_lane_u16, uint16x4_t, uint16x8_t, '2', '[N as u32; 8]'] |
| 1494 | - [_lane_p16, poly16x4_t, poly16x4_t, '2', '[N as u32, N as u32, N as u32, N as u32]'] | 1494 | - [_lane_p16, poly16x4_t, poly16x4_t, '2', '[N as u32; 4]'] |
| 1495 | - [q_lane_p16, poly16x4_t, poly16x8_t, '2', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1495 | - [q_lane_p16, poly16x4_t, poly16x8_t, '2', '[N as u32; 8]'] |
| 1496 | compose: | 1496 | compose: |
| 1497 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1497 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1498 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1498 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -1511,12 +1511,12 @@ intrinsics: | ... | @@ -1511,12 +1511,12 @@ intrinsics: |
| 1511 | static_defs: ['const N: i32'] | 1511 | static_defs: ['const N: i32'] |
| 1512 | safety: safe | 1512 | safety: safe |
| 1513 | types: | 1513 | types: |
| 1514 | - [q_laneq_s16, int16x8_t, int16x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1514 | - [q_laneq_s16, int16x8_t, int16x8_t, '3', '[N as u32; 8]'] |
| 1515 | - [_laneq_s16, int16x8_t, int16x4_t, '3', '[N as u32, N as u32, N as u32, N as u32]'] | 1515 | - [_laneq_s16, int16x8_t, int16x4_t, '3', '[N as u32; 4]'] |
| 1516 | - [q_laneq_u16, uint16x8_t, uint16x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1516 | - [q_laneq_u16, uint16x8_t, uint16x8_t, '3', '[N as u32; 8]'] |
| 1517 | - [_laneq_u16, uint16x8_t, uint16x4_t, '3', '[N as u32, N as u32, N as u32, N as u32]'] | 1517 | - [_laneq_u16, uint16x8_t, uint16x4_t, '3', '[N as u32; 4]'] |
| 1518 | - [q_laneq_p16, poly16x8_t, poly16x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1518 | - [q_laneq_p16, poly16x8_t, poly16x8_t, '3', '[N as u32; 8]'] |
| 1519 | - [_laneq_p16, poly16x8_t, poly16x4_t, '3', '[N as u32, N as u32, N as u32, N as u32]'] | 1519 | - [_laneq_p16, poly16x8_t, poly16x4_t, '3', '[N as u32; 4]'] |
| 1520 | compose: | 1520 | compose: |
| 1521 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1521 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1522 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1522 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -1538,8 +1538,8 @@ intrinsics: | ... | @@ -1538,8 +1538,8 @@ intrinsics: |
| 1538 | static_defs: ['const N: i32'] | 1538 | static_defs: ['const N: i32'] |
| 1539 | safety: safe | 1539 | safety: safe |
| 1540 | types: | 1540 | types: |
| 1541 | - [q_laneq_f16, float16x8_t, float16x8_t, '3', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1541 | - [q_laneq_f16, float16x8_t, float16x8_t, '3', '[N as u32; 8]'] |
| 1542 | - [_laneq_f16, float16x8_t, float16x4_t, '3', '[N as u32, N as u32, N as u32, N as u32]'] | 1542 | - [_laneq_f16, float16x8_t, float16x4_t, '3', '[N as u32; 4]'] |
| 1543 | compose: | 1543 | compose: |
| 1544 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1544 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1545 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1545 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -1578,8 +1578,8 @@ intrinsics: | ... | @@ -1578,8 +1578,8 @@ intrinsics: |
| 1578 | static_defs: ['const N: i32'] | 1578 | static_defs: ['const N: i32'] |
| 1579 | safety: safe | 1579 | safety: safe |
| 1580 | types: | 1580 | types: |
| 1581 | - [_lane_f16, float16x4_t, float16x4_t, '2', '[N as u32, N as u32, N as u32, N as u32]'] | 1581 | - [_lane_f16, float16x4_t, float16x4_t, '2', '[N as u32; 4]'] |
| 1582 | - [q_lane_f16, float16x4_t, float16x8_t, '2', '[N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32, N as u32]'] | 1582 | - [q_lane_f16, float16x4_t, float16x8_t, '2', '[N as u32; 8]'] |
| 1583 | compose: | 1583 | compose: |
| 1584 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] | 1584 | - FnCall: [static_assert_uimm_bits!, [N, "{type[3]}"]] |
| 1585 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] | 1585 | - FnCall: [simd_shuffle!, [a, a, "{type[4]}"]] |
| ... | @@ -5049,17 +5049,7 @@ intrinsics: | ... | @@ -5049,17 +5049,7 @@ intrinsics: |
| 5049 | types: | 5049 | types: |
| 5050 | - [i64, int64x1x2_t, int64x1_t] | 5050 | - [i64, int64x1x2_t, int64x1_t] |
| 5051 | compose: | 5051 | compose: |
| 5052 | - LLVMLink: | 5052 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5053 | name: 'vst2.{neon_type[1]}' | ||
| 5054 | arguments: | ||
| 5055 | - 'ptr: *mut i8' | ||
| 5056 | - 'a: {type[2]}' | ||
| 5057 | - 'b: {type[2]}' | ||
| 5058 | - 'size: i32' | ||
| 5059 | links: | ||
| 5060 | - link: 'llvm.arm.neon.vst2.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5061 | arch: arm | ||
| 5062 | - FnCall: ['_vst2{neon_type[1].nox}', ['a as _', 'b.0', 'b.1', '8']] | ||
| 5063 | 5053 | ||
| 5064 | - name: "vst2{neon_type[1].nox}" | 5054 | - name: "vst2{neon_type[1].nox}" |
| 5065 | doc: "Store multiple 2-element structures from two registers" | 5055 | doc: "Store multiple 2-element structures from two registers" |
| ... | @@ -5092,16 +5082,7 @@ intrinsics: | ... | @@ -5092,16 +5082,7 @@ intrinsics: |
| 5092 | types: | 5082 | types: |
| 5093 | - [i64, int64x1x2_t, int64x1_t] | 5083 | - [i64, int64x1x2_t, int64x1_t] |
| 5094 | compose: | 5084 | compose: |
| 5095 | - LLVMLink: | 5085 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5096 | name: 'st2.{neon_type[1]}' | ||
| 5097 | arguments: | ||
| 5098 | - 'a: {type[2]}' | ||
| 5099 | - 'b: {type[2]}' | ||
| 5100 | - 'ptr: *mut i8' | ||
| 5101 | links: | ||
| 5102 | - link: 'llvm.aarch64.neon.st2.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5103 | arch: aarch64,arm64ec | ||
| 5104 | - FnCall: ['_vst2{neon_type[1].nox}', ['b.0', 'b.1', 'a as _']] | ||
| 5105 | 5086 | ||
| 5106 | - name: "vst2{neon_type[1].nox}" | 5087 | - name: "vst2{neon_type[1].nox}" |
| 5107 | doc: "Store multiple 2-element structures from two registers" | 5088 | doc: "Store multiple 2-element structures from two registers" |
| ... | @@ -5113,26 +5094,16 @@ intrinsics: | ... | @@ -5113,26 +5094,16 @@ intrinsics: |
| 5113 | safety: | 5094 | safety: |
| 5114 | unsafe: [neon] | 5095 | unsafe: [neon] |
| 5115 | types: | 5096 | types: |
| 5116 | - [i8, int8x8x2_t, int8x8_t] | 5097 | - [i8, int8x8x2_t, "8"] |
| 5117 | - [i16, int16x4x2_t, int16x4_t] | 5098 | - [i16, int16x4x2_t, "4"] |
| 5118 | - [i32, int32x2x2_t, int32x2_t] | 5099 | - [i32, int32x2x2_t, "2"] |
| 5119 | - [i8, int8x16x2_t, int8x16_t] | 5100 | - [i8, int8x16x2_t, "16"] |
| 5120 | - [i16, int16x8x2_t, int16x8_t] | 5101 | - [i16, int16x8x2_t, "8"] |
| 5121 | - [i32, int32x4x2_t, int32x4_t] | 5102 | - [i32, int32x4x2_t, "4"] |
| 5122 | - [f32, float32x2x2_t, float32x2_t] | 5103 | - [f32, float32x2x2_t, "2"] |
| 5123 | - [f32, float32x4x2_t, float32x4_t] | 5104 | - [f32, float32x4x2_t, "4"] |
| 5124 | compose: | 5105 | compose: |
| 5125 | - LLVMLink: | 5106 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "2", a, b], [], true] |
| 5126 | name: 'st2.{neon_type[1]}' | ||
| 5127 | arguments: | ||
| 5128 | - 'a: {type[2]}' | ||
| 5129 | - 'b: {type[2]}' | ||
| 5130 | - 'ptr: *mut i8' | ||
| 5131 | links: | ||
| 5132 | - link: 'llvm.aarch64.neon.st2.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5133 | arch: aarch64,arm64ec | ||
| 5134 | - FnCall: ['_vst2{neon_type[1].nox}', ['b.0', 'b.1', 'a as _']] | ||
| 5135 | |||
| 5136 | 5107 | ||
| 5137 | - name: "vst2{neon_type[1].nox}" | 5108 | - name: "vst2{neon_type[1].nox}" |
| 5138 | doc: "Store multiple 2-element structures from two registers" | 5109 | doc: "Store multiple 2-element structures from two registers" |
| ... | @@ -5426,17 +5397,7 @@ intrinsics: | ... | @@ -5426,17 +5397,7 @@ intrinsics: |
| 5426 | types: | 5397 | types: |
| 5427 | - [i64, int64x1x3_t, int64x1_t] | 5398 | - [i64, int64x1x3_t, int64x1_t] |
| 5428 | compose: | 5399 | compose: |
| 5429 | - LLVMLink: | 5400 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5430 | name: 'st3.{neon_type[1].nox}' | ||
| 5431 | arguments: | ||
| 5432 | - 'a: {type[2]}' | ||
| 5433 | - 'b: {type[2]}' | ||
| 5434 | - 'c: {type[2]}' | ||
| 5435 | - 'ptr: *mut i8' | ||
| 5436 | links: | ||
| 5437 | - link: 'llvm.aarch64.neon.st3.v{neon_type[1].lane}{type[0]}.p0' | ||
| 5438 | arch: aarch64,arm64ec | ||
| 5439 | - FnCall: ['_vst3{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'a as _']] | ||
| 5440 | 5401 | ||
| 5441 | - name: "vst3{neon_type[1].nox}" | 5402 | - name: "vst3{neon_type[1].nox}" |
| 5442 | doc: "Store multiple 3-element structures from three registers" | 5403 | doc: "Store multiple 3-element structures from three registers" |
| ... | @@ -5471,18 +5432,7 @@ intrinsics: | ... | @@ -5471,18 +5432,7 @@ intrinsics: |
| 5471 | types: | 5432 | types: |
| 5472 | - [i64, int64x1x3_t, int64x1_t] | 5433 | - [i64, int64x1x3_t, int64x1_t] |
| 5473 | compose: | 5434 | compose: |
| 5474 | - LLVMLink: | 5435 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5475 | name: 'vst3.{neon_type[1]}' | ||
| 5476 | arguments: | ||
| 5477 | - 'ptr: *mut i8' | ||
| 5478 | - 'a: {type[2]}' | ||
| 5479 | - 'b: {type[2]}' | ||
| 5480 | - 'c: {type[2]}' | ||
| 5481 | - 'size: i32' | ||
| 5482 | links: | ||
| 5483 | - link: 'llvm.arm.neon.vst3.p0.v{neon_type[1].lane}{type[0]}' | ||
| 5484 | arch: arm | ||
| 5485 | - FnCall: ['_vst3{neon_type[1].nox}', ['a as _', 'b.0', 'b.1', 'b.2', '8']] | ||
| 5486 | 5436 | ||
| 5487 | - name: "vst3{neon_type[1].nox}" | 5437 | - name: "vst3{neon_type[1].nox}" |
| 5488 | doc: "Store multiple 3-element structures from three registers" | 5438 | doc: "Store multiple 3-element structures from three registers" |
| ... | @@ -5571,27 +5521,16 @@ intrinsics: | ... | @@ -5571,27 +5521,16 @@ intrinsics: |
| 5571 | safety: | 5521 | safety: |
| 5572 | unsafe: [neon] | 5522 | unsafe: [neon] |
| 5573 | types: | 5523 | types: |
| 5574 | - [i8, int8x8x3_t, int8x8_t, '1'] | 5524 | - [i8, int8x8x3_t, '8'] |
| 5575 | - [i16, int16x4x3_t, int16x4_t, '2'] | 5525 | - [i16, int16x4x3_t, '4'] |
| 5576 | - [i32, int32x2x3_t, int32x2_t, '4'] | 5526 | - [i32, int32x2x3_t, '2'] |
| 5577 | - [i8, int8x16x3_t, int8x16_t, '1'] | 5527 | - [i8, int8x16x3_t, '16'] |
| 5578 | - [i16, int16x8x3_t, int16x8_t, '2'] | 5528 | - [i16, int16x8x3_t, '8'] |
| 5579 | - [i32, int32x4x3_t, int32x4_t, '4'] | 5529 | - [i32, int32x4x3_t, '4'] |
| 5580 | - [f32, float32x2x3_t, float32x2_t, '4'] | 5530 | - [f32, float32x2x3_t, '2'] |
| 5581 | - [f32, float32x4x3_t, float32x4_t, '4'] | 5531 | - [f32, float32x4x3_t, '4'] |
| 5582 | compose: | 5532 | compose: |
| 5583 | - LLVMLink: | 5533 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "3", a, b], [], true] |
| 5584 | name: 'vst3.{neon_type[1]}' | ||
| 5585 | arguments: | ||
| 5586 | - 'ptr: *mut i8' | ||
| 5587 | - 'a: {type[2]}' | ||
| 5588 | - 'b: {type[2]}' | ||
| 5589 | - 'c: {type[2]}' | ||
| 5590 | - 'size: i32' | ||
| 5591 | links: | ||
| 5592 | - link: 'llvm.arm.neon.vst3.p0.v{neon_type[1].lane}{type[0]}' | ||
| 5593 | arch: arm | ||
| 5594 | - FnCall: ['_vst3{neon_type[1].nox}', ['a as _', 'b.0', 'b.1', 'b.2', "{type[3]}"]] | ||
| 5595 | 5534 | ||
| 5596 | 5535 | ||
| 5597 | - name: "vst3{neon_type[1].nox}" | 5536 | - name: "vst3{neon_type[1].nox}" |
| ... | @@ -5853,19 +5792,7 @@ intrinsics: | ... | @@ -5853,19 +5792,7 @@ intrinsics: |
| 5853 | types: | 5792 | types: |
| 5854 | - [i64, int64x1x4_t, int64x1_t] | 5793 | - [i64, int64x1x4_t, int64x1_t] |
| 5855 | compose: | 5794 | compose: |
| 5856 | - LLVMLink: | 5795 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5857 | name: 'vst4.{neon_type[1]}' | ||
| 5858 | arguments: | ||
| 5859 | - 'ptr: *mut i8' | ||
| 5860 | - 'a: {type[2]}' | ||
| 5861 | - 'b: {type[2]}' | ||
| 5862 | - 'c: {type[2]}' | ||
| 5863 | - 'd: {type[2]}' | ||
| 5864 | - 'size: i32' | ||
| 5865 | links: | ||
| 5866 | - link: 'llvm.arm.neon.vst4.p0.v{neon_type[1].lane}{type[0]}' | ||
| 5867 | arch: arm | ||
| 5868 | - FnCall: ['_vst4{neon_type[1].nox}', ['a as _', 'b.0', 'b.1', 'b.2', 'b.3', '8']] | ||
| 5869 | 5796 | ||
| 5870 | - name: "vst4{neon_type[1].nox}" | 5797 | - name: "vst4{neon_type[1].nox}" |
| 5871 | doc: "Store multiple 4-element structures from four registers" | 5798 | doc: "Store multiple 4-element structures from four registers" |
| ... | @@ -5879,18 +5806,7 @@ intrinsics: | ... | @@ -5879,18 +5806,7 @@ intrinsics: |
| 5879 | types: | 5806 | types: |
| 5880 | - [i64, int64x1x4_t, int64x1_t] | 5807 | - [i64, int64x1x4_t, int64x1_t] |
| 5881 | compose: | 5808 | compose: |
| 5882 | - LLVMLink: | 5809 | - FnCall: [core::ptr::write_unaligned, ['a.cast()', b]] |
| 5883 | name: 'vst4.{neon_type[1]}' | ||
| 5884 | arguments: | ||
| 5885 | - 'a: {type[2]}' | ||
| 5886 | - 'b: {type[2]}' | ||
| 5887 | - 'c: {type[2]}' | ||
| 5888 | - 'd: {type[2]}' | ||
| 5889 | - 'ptr: *mut i8' | ||
| 5890 | links: | ||
| 5891 | - link: 'llvm.aarch64.neon.st4.{neon_type[2]}.p0' | ||
| 5892 | arch: aarch64,arm64ec | ||
| 5893 | - FnCall: ['_vst4{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'b.3', 'a as _']] | ||
| 5894 | 5810 | ||
| 5895 | - name: "vst4{neon_type[1].nox}" | 5811 | - name: "vst4{neon_type[1].nox}" |
| 5896 | doc: "Store multiple 4-element structures from four registers" | 5812 | doc: "Store multiple 4-element structures from four registers" |
| ... | @@ -6114,27 +6030,16 @@ intrinsics: | ... | @@ -6114,27 +6030,16 @@ intrinsics: |
| 6114 | safety: | 6030 | safety: |
| 6115 | unsafe: [neon] | 6031 | unsafe: [neon] |
| 6116 | types: | 6032 | types: |
| 6117 | - [i8, int8x8x4_t, int8x8_t] | 6033 | - [i8, int8x8x4_t, "8"] |
| 6118 | - [i16, int16x4x4_t, int16x4_t] | 6034 | - [i16, int16x4x4_t, "4"] |
| 6119 | - [i32, int32x2x4_t, int32x2_t] | 6035 | - [i32, int32x2x4_t, "2"] |
| 6120 | - [i8, int8x16x4_t, int8x16_t] | 6036 | - [i8, int8x16x4_t, "16"] |
| 6121 | - [i16, int16x8x4_t, int16x8_t] | 6037 | - [i16, int16x8x4_t, "8"] |
| 6122 | - [i32, int32x4x4_t, int32x4_t] | 6038 | - [i32, int32x4x4_t, "4"] |
| 6123 | - [f32, float32x2x4_t, float32x2_t] | 6039 | - [f32, float32x2x4_t, "2"] |
| 6124 | - [f32, float32x4x4_t, float32x4_t] | 6040 | - [f32, float32x4x4_t, "4"] |
| 6125 | compose: | 6041 | compose: |
| 6126 | - LLVMLink: | 6042 | - FnCall: ["crate::core_arch::macros::interleaving_store!", [{ Type: "{type[0]}" }, "{type[2]}", "4", a, b], [], true] |
| 6127 | name: 'vst4.{neon_type[1]}' | ||
| 6128 | arguments: | ||
| 6129 | - 'a: {type[2]}' | ||
| 6130 | - 'b: {type[2]}' | ||
| 6131 | - 'c: {type[2]}' | ||
| 6132 | - 'd: {type[2]}' | ||
| 6133 | - 'ptr: *mut i8' | ||
| 6134 | links: | ||
| 6135 | - link: 'llvm.aarch64.neon.st4.v{neon_type[1].lane}{type[0]}.p0' | ||
| 6136 | arch: aarch64,arm64ec | ||
| 6137 | - FnCall: ['_vst4{neon_type[1].nox}', ['b.0', 'b.1', 'b.2', 'b.3', 'a as _']] | ||
| 6138 | 6043 | ||
| 6139 | 6044 | ||
| 6140 | - name: "vst4{neon_type[1].nox}" | 6045 | - name: "vst4{neon_type[1].nox}" |
| ... | @@ -7675,7 +7580,7 @@ intrinsics: | ... | @@ -7675,7 +7580,7 @@ intrinsics: |
| 7675 | static_defs: ['const N: i32'] | 7580 | static_defs: ['const N: i32'] |
| 7676 | safety: safe | 7581 | safety: safe |
| 7677 | types: | 7582 | types: |
| 7678 | - [int16x4_t, int16x4_t, int32x4_t, '[N as u32, N as u32, N as u32, N as u32]'] | 7583 | - [int16x4_t, int16x4_t, int32x4_t, '[N as u32; 4]'] |
| 7679 | compose: | 7584 | compose: |
| 7680 | - FnCall: [static_assert_uimm_bits!, [N, '2']] | 7585 | - FnCall: [static_assert_uimm_bits!, [N, '2']] |
| 7681 | - Let: [b, "{neon_type[0]}", {FnCall: [simd_shuffle!, [b, b, "{type[3]}"]]}] | 7586 | - Let: [b, "{neon_type[0]}", {FnCall: [simd_shuffle!, [b, b, "{type[3]}"]]}] |
| ... | @@ -7695,7 +7600,7 @@ intrinsics: | ... | @@ -7695,7 +7600,7 @@ intrinsics: |
| 7695 | static_defs: ['const N: i32'] | 7600 | static_defs: ['const N: i32'] |
| 7696 | safety: safe | 7601 | safety: safe |
| 7697 | types: | 7602 | types: |
| 7698 | - [int32x2_t, int32x2_t, int64x2_t, '[N as u32, N as u32]'] | 7603 | - [int32x2_t, int32x2_t, int64x2_t, '[N as u32; 2]'] |
| 7699 | compose: | 7604 | compose: |
| 7700 | - FnCall: [static_assert_uimm_bits!, [N, '1']] | 7605 | - FnCall: [static_assert_uimm_bits!, [N, '1']] |
| 7701 | - Let: [b, "{neon_type[0]}", {FnCall: [simd_shuffle!, [b, b, "{type[3]}"]]}] | 7606 | - Let: [b, "{neon_type[0]}", {FnCall: [simd_shuffle!, [b, b, "{type[3]}"]]}] |
| ... | @@ -8320,9 +8225,9 @@ intrinsics: | ... | @@ -8320,9 +8225,9 @@ intrinsics: |
| 8320 | static_defs: ['const N: i32'] | 8225 | static_defs: ['const N: i32'] |
| 8321 | safety: safe | 8226 | safety: safe |
| 8322 | types: | 8227 | types: |
| 8323 | - [uint16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { uint16x8_t([-N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16]) }'] | 8228 | - [uint16x8_t, uint8x8_t, 'N >= 1 && N <= 8', 'const { uint16x8_t([-N as u16; 8]) }'] |
| 8324 | - [uint32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { uint32x4_t([-N as u32, -N as u32, -N as u32, -N as u32]) }'] | 8229 | - [uint32x4_t, uint16x4_t, 'N >= 1 && N <= 16', 'const { uint32x4_t([-N as u32; 4]) }'] |
| 8325 | - [uint64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { uint64x2_t([-N as u64, -N as u64]) }'] | 8230 | - [uint64x2_t, uint32x2_t, 'N >= 1 && N <= 32', 'const { uint64x2_t([-N as u64; 2]) }'] |
| 8326 | compose: | 8231 | compose: |
| 8327 | - FnCall: [static_assert!, ["{type[2]}"]] | 8232 | - FnCall: [static_assert!, ["{type[2]}"]] |
| 8328 | - LLVMLink: | 8233 | - LLVMLink: |
| ... | @@ -10789,9 +10694,9 @@ intrinsics: | ... | @@ -10789,9 +10694,9 @@ intrinsics: |
| 10789 | static_defs: ['const N: i32'] | 10694 | static_defs: ['const N: i32'] |
| 10790 | safety: safe | 10695 | safety: safe |
| 10791 | types: | 10696 | types: |
| 10792 | - [uint16x8_t, uint8x8_t, '8', 'const { uint16x8_t([-N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16, -N as u16]) }'] | 10697 | - [uint16x8_t, uint8x8_t, '8', 'const { uint16x8_t([-N as u16; 8]) }'] |
| 10793 | - [uint32x4_t, uint16x4_t, '16', 'const { uint32x4_t([-N as u32, -N as u32, -N as u32, -N as u32]) }'] | 10698 | - [uint32x4_t, uint16x4_t, '16', 'const { uint32x4_t([-N as u32; 4]) }'] |
| 10794 | - [uint64x2_t, uint32x2_t, '32', 'const { uint64x2_t([-N as u64, -N as u64]) }'] | 10699 | - [uint64x2_t, uint32x2_t, '32', 'const { uint64x2_t([-N as u64; 2]) }'] |
| 10795 | compose: | 10700 | compose: |
| 10796 | - FnCall: [static_assert!, ['N >= 1 && N <= {type[2]}']] | 10701 | - FnCall: [static_assert!, ['N >= 1 && N <= {type[2]}']] |
| 10797 | - LLVMLink: | 10702 | - LLVMLink: |
library/stdarch/crates/stdarch-verify/tests/x86-intel.rs-1| ... | @@ -246,7 +246,6 @@ fn verify_all_signatures() { | ... | @@ -246,7 +246,6 @@ fn verify_all_signatures() { |
| 246 | "_xend", | 246 | "_xend", |
| 247 | "_xabort_code", | 247 | "_xabort_code", |
| 248 | // Aliases | 248 | // Aliases |
| 249 | "_mm_comige_ss", | ||
| 250 | "_mm_cvt_ss2si", | 249 | "_mm_cvt_ss2si", |
| 251 | "_mm_cvtt_ss2si", | 250 | "_mm_cvtt_ss2si", |
| 252 | "_mm_cvt_si2ss", | 251 | "_mm_cvt_si2ss", |
src/doc/rustc/src/check-cfg.md+1-1| ... | @@ -53,7 +53,7 @@ To check for the _none_ value (ie `#[cfg(foo)]`) one can use the `none()` predic | ... | @@ -53,7 +53,7 @@ To check for the _none_ value (ie `#[cfg(foo)]`) one can use the `none()` predic |
| 53 | `values()`: `values(none())`. It can be followed or preceded by any number of `"value"`. | 53 | `values()`: `values(none())`. It can be followed or preceded by any number of `"value"`. |
| 54 | 54 | ||
| 55 | To enable checking of values, but to provide an *none*/empty set of expected values | 55 | To enable checking of values, but to provide an *none*/empty set of expected values |
| 56 | (ie. expect `#[cfg(name)]`), use these forms: | 56 | (i.e. expect `#[cfg(name)]`), use these forms: |
| 57 | 57 | ||
| 58 | ```bash | 58 | ```bash |
| 59 | rustc --check-cfg 'cfg(name)' | 59 | rustc --check-cfg 'cfg(name)' |
src/tools/clippy/clippy_lints/src/trait_bounds.rs+1-1| ... | @@ -110,7 +110,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds { | ... | @@ -110,7 +110,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds { |
| 110 | 110 | ||
| 111 | fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { | 111 | fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { |
| 112 | // special handling for self trait bounds as these are not considered generics | 112 | // special handling for self trait bounds as these are not considered generics |
| 113 | // ie. trait Foo: Display {} | 113 | // i.e. trait Foo: Display {} |
| 114 | if let Item { | 114 | if let Item { |
| 115 | kind: ItemKind::Trait(_, _, _, _, _, bounds, ..), | 115 | kind: ItemKind::Trait(_, _, _, _, _, bounds, ..), |
| 116 | .. | 116 | .. |
src/tools/clippy/clippy_utils/src/ast_utils/mod.rs+26| ... | @@ -449,6 +449,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { | ... | @@ -449,6 +449,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { |
| 449 | constness: lc, | 449 | constness: lc, |
| 450 | is_auto: la, | 450 | is_auto: la, |
| 451 | safety: lu, | 451 | safety: lu, |
| 452 | impl_restriction: liprt, | ||
| 452 | ident: li, | 453 | ident: li, |
| 453 | generics: lg, | 454 | generics: lg, |
| 454 | bounds: lb, | 455 | bounds: lb, |
| ... | @@ -458,6 +459,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { | ... | @@ -458,6 +459,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { |
| 458 | constness: rc, | 459 | constness: rc, |
| 459 | is_auto: ra, | 460 | is_auto: ra, |
| 460 | safety: ru, | 461 | safety: ru, |
| 462 | impl_restriction: riprt, | ||
| 461 | ident: ri, | 463 | ident: ri, |
| 462 | generics: rg, | 464 | generics: rg, |
| 463 | bounds: rb, | 465 | bounds: rb, |
| ... | @@ -467,6 +469,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { | ... | @@ -467,6 +469,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool { |
| 467 | matches!(lc, ast::Const::No) == matches!(rc, ast::Const::No) | 469 | matches!(lc, ast::Const::No) == matches!(rc, ast::Const::No) |
| 468 | && la == ra | 470 | && la == ra |
| 469 | && matches!(lu, Safety::Default) == matches!(ru, Safety::Default) | 471 | && matches!(lu, Safety::Default) == matches!(ru, Safety::Default) |
| 472 | && eq_impl_restriction(liprt, riprt) | ||
| 470 | && eq_id(*li, *ri) | 473 | && eq_id(*li, *ri) |
| 471 | && eq_generics(lg, rg) | 474 | && eq_generics(lg, rg) |
| 472 | && over(lb, rb, eq_generic_bound) | 475 | && over(lb, rb, eq_generic_bound) |
| ... | @@ -834,6 +837,29 @@ pub fn eq_vis(l: &Visibility, r: &Visibility) -> bool { | ... | @@ -834,6 +837,29 @@ pub fn eq_vis(l: &Visibility, r: &Visibility) -> bool { |
| 834 | } | 837 | } |
| 835 | } | 838 | } |
| 836 | 839 | ||
| 840 | pub fn eq_impl_restriction(l: &ImplRestriction, r: &ImplRestriction) -> bool { | ||
| 841 | eq_restriction_kind(&l.kind, &r.kind) | ||
| 842 | } | ||
| 843 | |||
| 844 | fn eq_restriction_kind(l: &RestrictionKind, r: &RestrictionKind) -> bool { | ||
| 845 | match (l, r) { | ||
| 846 | (RestrictionKind::Unrestricted, RestrictionKind::Unrestricted) => true, | ||
| 847 | ( | ||
| 848 | RestrictionKind::Restricted { | ||
| 849 | path: l_path, | ||
| 850 | shorthand: l_short, | ||
| 851 | id: _, | ||
| 852 | }, | ||
| 853 | RestrictionKind::Restricted { | ||
| 854 | path: r_path, | ||
| 855 | shorthand: r_short, | ||
| 856 | id: _, | ||
| 857 | }, | ||
| 858 | ) => l_short == r_short && eq_path(l_path, r_path), | ||
| 859 | _ => false, | ||
| 860 | } | ||
| 861 | } | ||
| 862 | |||
| 837 | pub fn eq_fn_decl(l: &FnDecl, r: &FnDecl) -> bool { | 863 | pub fn eq_fn_decl(l: &FnDecl, r: &FnDecl) -> bool { |
| 838 | eq_fn_ret_ty(&l.output, &r.output) | 864 | eq_fn_ret_ty(&l.output, &r.output) |
| 839 | && over(&l.inputs, &r.inputs, |l, r| { | 865 | && over(&l.inputs, &r.inputs, |l, r| { |
src/tools/miri/tests/fail/shims/shim_arg_size.rs+1-1| ... | @@ -1,6 +1,6 @@ | ... | @@ -1,6 +1,6 @@ |
| 1 | fn main() { | 1 | fn main() { |
| 2 | extern "C" { | 2 | extern "C" { |
| 3 | // Use the wrong type (ie. not `i32`) for the `c` argument. | 3 | // Use the wrong type (i.e. not `i32`) for the `c` argument. |
| 4 | fn memchr(s: *const std::ffi::c_void, c: u8, n: usize) -> *mut std::ffi::c_void; | 4 | fn memchr(s: *const std::ffi::c_void, c: u8, n: usize) -> *mut std::ffi::c_void; |
| 5 | } | 5 | } |
| 6 | 6 |
src/tools/rust-analyzer/crates/base-db/src/input.rs+1-1| ... | @@ -742,7 +742,7 @@ impl CrateGraphBuilder { | ... | @@ -742,7 +742,7 @@ impl CrateGraphBuilder { |
| 742 | deps.into_iter() | 742 | deps.into_iter() |
| 743 | } | 743 | } |
| 744 | 744 | ||
| 745 | /// Returns all crates in the graph, sorted in topological order (ie. dependencies of a crate | 745 | /// Returns all crates in the graph, sorted in topological order (i.e. dependencies of a crate |
| 746 | /// come before the crate itself). | 746 | /// come before the crate itself). |
| 747 | fn crates_in_topological_order(&self) -> Vec<CrateBuilderId> { | 747 | fn crates_in_topological_order(&self) -> Vec<CrateBuilderId> { |
| 748 | let mut res = Vec::new(); | 748 | let mut res = Vec::new(); |
src/tools/rust-analyzer/crates/hir-def/src/visibility.rs+2-2| ... | @@ -146,7 +146,7 @@ impl Visibility { | ... | @@ -146,7 +146,7 @@ impl Visibility { |
| 146 | 146 | ||
| 147 | /// Returns the most permissive visibility of `self` and `other`. | 147 | /// Returns the most permissive visibility of `self` and `other`. |
| 148 | /// | 148 | /// |
| 149 | /// If there is no subset relation between `self` and `other`, returns `None` (ie. they're only | 149 | /// If there is no subset relation between `self` and `other`, returns `None` (i.e. they're only |
| 150 | /// visible in unrelated modules). | 150 | /// visible in unrelated modules). |
| 151 | pub(crate) fn max( | 151 | pub(crate) fn max( |
| 152 | self, | 152 | self, |
| ... | @@ -212,7 +212,7 @@ impl Visibility { | ... | @@ -212,7 +212,7 @@ impl Visibility { |
| 212 | 212 | ||
| 213 | /// Returns the least permissive visibility of `self` and `other`. | 213 | /// Returns the least permissive visibility of `self` and `other`. |
| 214 | /// | 214 | /// |
| 215 | /// If there is no subset relation between `self` and `other`, returns `None` (ie. they're only | 215 | /// If there is no subset relation between `self` and `other`, returns `None` (i.e. they're only |
| 216 | /// visible in unrelated modules). | 216 | /// visible in unrelated modules). |
| 217 | pub(crate) fn min( | 217 | pub(crate) fn min( |
| 218 | self, | 218 | self, |
src/tools/rustfmt/src/items.rs+3-1| ... | @@ -1158,6 +1158,7 @@ pub(crate) fn format_trait( | ... | @@ -1158,6 +1158,7 @@ pub(crate) fn format_trait( |
| 1158 | constness, | 1158 | constness, |
| 1159 | is_auto, | 1159 | is_auto, |
| 1160 | safety, | 1160 | safety, |
| 1161 | ref impl_restriction, | ||
| 1161 | ident, | 1162 | ident, |
| 1162 | ref generics, | 1163 | ref generics, |
| 1163 | ref bounds, | 1164 | ref bounds, |
| ... | @@ -1166,11 +1167,12 @@ pub(crate) fn format_trait( | ... | @@ -1166,11 +1167,12 @@ pub(crate) fn format_trait( |
| 1166 | 1167 | ||
| 1167 | let mut result = String::with_capacity(128); | 1168 | let mut result = String::with_capacity(128); |
| 1168 | let header = format!( | 1169 | let header = format!( |
| 1169 | "{}{}{}{}trait ", | 1170 | "{}{}{}{}{}trait ", |
| 1170 | format_visibility(context, &item.vis), | 1171 | format_visibility(context, &item.vis), |
| 1171 | format_constness(constness), | 1172 | format_constness(constness), |
| 1172 | format_safety(safety), | 1173 | format_safety(safety), |
| 1173 | format_auto(is_auto), | 1174 | format_auto(is_auto), |
| 1175 | format_impl_restriction(context, impl_restriction), | ||
| 1174 | ); | 1176 | ); |
| 1175 | result.push_str(&header); | 1177 | result.push_str(&header); |
| 1176 | 1178 |
src/tools/rustfmt/src/utils.rs+36-2| ... | @@ -2,8 +2,8 @@ use std::borrow::Cow; | ... | @@ -2,8 +2,8 @@ use std::borrow::Cow; |
| 2 | 2 | ||
| 3 | use rustc_ast::YieldKind; | 3 | use rustc_ast::YieldKind; |
| 4 | use rustc_ast::ast::{ | 4 | use rustc_ast::ast::{ |
| 5 | self, Attribute, MetaItem, MetaItemInner, MetaItemKind, NodeId, Path, Visibility, | 5 | self, Attribute, ImplRestriction, MetaItem, MetaItemInner, MetaItemKind, NodeId, Path, |
| 6 | VisibilityKind, | 6 | RestrictionKind, Visibility, VisibilityKind, |
| 7 | }; | 7 | }; |
| 8 | use rustc_ast_pretty::pprust; | 8 | use rustc_ast_pretty::pprust; |
| 9 | use rustc_span::{BytePos, LocalExpnId, Span, Symbol, SyntaxContext, sym, symbol}; | 9 | use rustc_span::{BytePos, LocalExpnId, Span, Symbol, SyntaxContext, sym, symbol}; |
| ... | @@ -74,6 +74,40 @@ pub(crate) fn format_visibility( | ... | @@ -74,6 +74,40 @@ pub(crate) fn format_visibility( |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | pub(crate) fn format_impl_restriction( | ||
| 78 | context: &RewriteContext<'_>, | ||
| 79 | impl_restriction: &ImplRestriction, | ||
| 80 | ) -> String { | ||
| 81 | format_restriction("impl", context, &impl_restriction.kind) | ||
| 82 | } | ||
| 83 | |||
| 84 | fn format_restriction( | ||
| 85 | kw: &'static str, | ||
| 86 | context: &RewriteContext<'_>, | ||
| 87 | restriction: &RestrictionKind, | ||
| 88 | ) -> String { | ||
| 89 | match restriction { | ||
| 90 | RestrictionKind::Unrestricted => String::new(), | ||
| 91 | RestrictionKind::Restricted { | ||
| 92 | ref path, | ||
| 93 | id: _, | ||
| 94 | shorthand, | ||
| 95 | } => { | ||
| 96 | let Path { ref segments, .. } = **path; | ||
| 97 | let mut segments_iter = segments.iter().map(|seg| rewrite_ident(context, seg.ident)); | ||
| 98 | if path.is_global() && segments_iter.next().is_none() { | ||
| 99 | panic!("non-global path in {kw}(restricted)?"); | ||
| 100 | } | ||
| 101 | // FIXME use `segments_iter.intersperse("::").collect::<String>()` once | ||
| 102 | // `#![feature(iter_intersperse)]` is re-stabilized. | ||
| 103 | let path = itertools::join(segments_iter, "::"); | ||
| 104 | let in_str = if *shorthand { "" } else { "in " }; | ||
| 105 | |||
| 106 | format!("{kw}({in_str}{path}) ") | ||
| 107 | } | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 77 | #[inline] | 111 | #[inline] |
| 78 | pub(crate) fn format_coro(coroutine_kind: &ast::CoroutineKind) -> &'static str { | 112 | pub(crate) fn format_coro(coroutine_kind: &ast::CoroutineKind) -> &'static str { |
| 79 | match coroutine_kind { | 113 | match coroutine_kind { |
src/tools/rustfmt/tests/source/impl-restriction.rs created+41| ... | @@ -0,0 +1,41 @@ | ||
| 1 | #![feature(impl_restriction)] | ||
| 2 | |||
| 3 | pub | ||
| 4 | impl(crate) | ||
| 5 | trait Foo {} | ||
| 6 | |||
| 7 | pub impl | ||
| 8 | ( in | ||
| 9 | crate ) | ||
| 10 | trait | ||
| 11 | Bar | ||
| 12 | {} | ||
| 13 | |||
| 14 | pub | ||
| 15 | impl ( in foo | ||
| 16 | :: | ||
| 17 | bar ) | ||
| 18 | trait Baz {} | ||
| 19 | |||
| 20 | pub | ||
| 21 | const | ||
| 22 | impl | ||
| 23 | (self) | ||
| 24 | trait QuxConst {} | ||
| 25 | |||
| 26 | pub | ||
| 27 | auto impl( | ||
| 28 | super | ||
| 29 | ) | ||
| 30 | trait QuxAuto {} | ||
| 31 | |||
| 32 | pub | ||
| 33 | unsafe impl | ||
| 34 | (in crate) | ||
| 35 | trait QuxUnsafe {} | ||
| 36 | |||
| 37 | pub const | ||
| 38 | unsafe impl | ||
| 39 | (in super | ||
| 40 | ::foo) | ||
| 41 | trait QuxConstUnsafe {} | ||
src/tools/rustfmt/tests/target/impl-restriction.rs created+15| ... | @@ -0,0 +1,15 @@ | ||
| 1 | #![feature(impl_restriction)] | ||
| 2 | |||
| 3 | pub impl(crate) trait Foo {} | ||
| 4 | |||
| 5 | pub impl(in crate) trait Bar {} | ||
| 6 | |||
| 7 | pub impl(in foo::bar) trait Baz {} | ||
| 8 | |||
| 9 | pub const impl(self) trait QuxConst {} | ||
| 10 | |||
| 11 | pub auto impl(super) trait QuxAuto {} | ||
| 12 | |||
| 13 | pub unsafe impl(in crate) trait QuxUnsafe {} | ||
| 14 | |||
| 15 | pub const unsafe impl(in super::foo) trait QuxConstUnsafe {} | ||
tests/codegen-llvm/riscv-abi/call-llvm-intrinsics.rs+13-13| ... | @@ -1,17 +1,20 @@ | ... | @@ -1,17 +1,20 @@ |
| 1 | //@ add-minicore | ||
| 1 | //@ compile-flags: -C no-prepopulate-passes | 2 | //@ compile-flags: -C no-prepopulate-passes |
| 2 | 3 | //@ revisions: riscv32gc riscv64gc | |
| 3 | //@ only-riscv64 | 4 | //@ [riscv32gc] compile-flags: --target riscv32gc-unknown-linux-gnu |
| 5 | //@ [riscv32gc] needs-llvm-components: riscv | ||
| 6 | //@ [riscv64gc] compile-flags: --target riscv64gc-unknown-linux-gnu | ||
| 7 | //@ [riscv64gc] needs-llvm-components: riscv | ||
| 8 | //@ min-llvm-version: 21 | ||
| 4 | 9 | ||
| 5 | #![feature(link_llvm_intrinsics)] | 10 | #![feature(link_llvm_intrinsics)] |
| 11 | #![feature(no_core, lang_items)] | ||
| 12 | #![no_std] | ||
| 13 | #![no_core] | ||
| 6 | #![crate_type = "lib"] | 14 | #![crate_type = "lib"] |
| 7 | 15 | ||
| 8 | struct A; | 16 | extern crate minicore; |
| 9 | 17 | use minicore::*; | |
| 10 | impl Drop for A { | ||
| 11 | fn drop(&mut self) { | ||
| 12 | println!("A"); | ||
| 13 | } | ||
| 14 | } | ||
| 15 | 18 | ||
| 16 | extern "C" { | 19 | extern "C" { |
| 17 | #[link_name = "llvm.sqrt.f32"] | 20 | #[link_name = "llvm.sqrt.f32"] |
| ... | @@ -19,12 +22,9 @@ extern "C" { | ... | @@ -19,12 +22,9 @@ extern "C" { |
| 19 | } | 22 | } |
| 20 | 23 | ||
| 21 | pub fn do_call() { | 24 | pub fn do_call() { |
| 22 | let _a = A; | ||
| 23 | |||
| 24 | unsafe { | 25 | unsafe { |
| 25 | // Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them | 26 | // Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them |
| 26 | // CHECK: store float 4.000000e+00, ptr %{{.}}, align 4 | 27 | // CHECK: call float @llvm.sqrt.f32(float 4.000000e+00) |
| 27 | // CHECK: call float @llvm.sqrt.f32(float %{{.}} | ||
| 28 | sqrt(4.0); | 28 | sqrt(4.0); |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
tests/run-make/print-cfg/rmake.rs+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | //! This checks the output of `--print=cfg` | 1 | //! This checks the output of `--print=cfg` |
| 2 | //! | 2 | //! |
| 3 | //! Specifically it checks that output is correctly formatted | 3 | //! Specifically it checks that output is correctly formatted |
| 4 | //! (ie. no duplicated cfgs, values are between "", names are not). | 4 | //! (i.e. no duplicated cfgs, values are between "", names are not). |
| 5 | //! | 5 | //! |
| 6 | //! It also checks that some targets have the correct set cfgs. | 6 | //! It also checks that some targets have the correct set cfgs. |
| 7 | 7 |
tests/run-make/remap-path-prefix-std/rmake.rs+1-1| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | // This test makes sure that we do not leak paths to the checkout | 1 | // This test makes sure that we do not leak paths to the checkout |
| 2 | // (ie. /checkout in CI) in the distributed `libstd` debuginfo. | 2 | // (i.e. /checkout in CI) in the distributed `libstd` debuginfo. |
| 3 | // | 3 | // |
| 4 | // This test only runs on Linux and dist builder (or with `rust.remap-debuginfo = true` | 4 | // This test only runs on Linux and dist builder (or with `rust.remap-debuginfo = true` |
| 5 | // set in your `bootstrap.toml`). | 5 | // set in your `bootstrap.toml`). |
tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs+13-12| ... | @@ -18,7 +18,7 @@ extern crate rustc_target; | ... | @@ -18,7 +18,7 @@ extern crate rustc_target; |
| 18 | use std::any::Any; | 18 | use std::any::Any; |
| 19 | 19 | ||
| 20 | use rustc_codegen_ssa::traits::CodegenBackend; | 20 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 21 | use rustc_codegen_ssa::{CodegenResults, CrateInfo}; | 21 | use rustc_codegen_ssa::{CompiledModules, CrateInfo}; |
| 22 | use rustc_data_structures::fx::FxIndexMap; | 22 | use rustc_data_structures::fx::FxIndexMap; |
| 23 | use rustc_metadata::EncodedMetadata; | 23 | use rustc_metadata::EncodedMetadata; |
| 24 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; | 24 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| ... | @@ -33,12 +33,12 @@ impl CodegenBackend for TheBackend { | ... | @@ -33,12 +33,12 @@ impl CodegenBackend for TheBackend { |
| 33 | "the-backend" | 33 | "the-backend" |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> { | 36 | fn target_cpu(&self, _sess: &Session) -> String { |
| 37 | Box::new(CodegenResults { | 37 | "fake_target_cpu".to_owned() |
| 38 | modules: vec![], | 38 | } |
| 39 | allocator_module: None, | 39 | |
| 40 | crate_info: CrateInfo::new(tcx, "fake_target_cpu".to_string()), | 40 | fn codegen_crate(&self, _tcx: TyCtxt<'_>, _crate_info: &CrateInfo) -> Box<dyn Any> { |
| 41 | }) | 41 | Box::new(CompiledModules { modules: vec![], allocator_module: None }) |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | fn join_codegen( | 44 | fn join_codegen( |
| ... | @@ -46,17 +46,18 @@ impl CodegenBackend for TheBackend { | ... | @@ -46,17 +46,18 @@ impl CodegenBackend for TheBackend { |
| 46 | ongoing_codegen: Box<dyn Any>, | 46 | ongoing_codegen: Box<dyn Any>, |
| 47 | _sess: &Session, | 47 | _sess: &Session, |
| 48 | _outputs: &OutputFilenames, | 48 | _outputs: &OutputFilenames, |
| 49 | ) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { | 49 | ) -> (CompiledModules, FxIndexMap<WorkProductId, WorkProduct>) { |
| 50 | let codegen_results = ongoing_codegen | 50 | let codegen_results = ongoing_codegen |
| 51 | .downcast::<CodegenResults>() | 51 | .downcast::<CompiledModules>() |
| 52 | .expect("in join_codegen: ongoing_codegen is not a CodegenResults"); | 52 | .expect("in join_codegen: ongoing_codegen is not a CompiledModules"); |
| 53 | (*codegen_results, FxIndexMap::default()) | 53 | (*codegen_results, FxIndexMap::default()) |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | fn link( | 56 | fn link( |
| 57 | &self, | 57 | &self, |
| 58 | sess: &Session, | 58 | sess: &Session, |
| 59 | codegen_results: CodegenResults, | 59 | _compiled_modules: CompiledModules, |
| 60 | crate_info: CrateInfo, | ||
| 60 | _metadata: EncodedMetadata, | 61 | _metadata: EncodedMetadata, |
| 61 | outputs: &OutputFilenames, | 62 | outputs: &OutputFilenames, |
| 62 | ) { | 63 | ) { |
| ... | @@ -65,7 +66,7 @@ impl CodegenBackend for TheBackend { | ... | @@ -65,7 +66,7 @@ impl CodegenBackend for TheBackend { |
| 65 | use rustc_session::config::{CrateType, OutFileName}; | 66 | use rustc_session::config::{CrateType, OutFileName}; |
| 66 | use rustc_session::output::out_filename; | 67 | use rustc_session::output::out_filename; |
| 67 | 68 | ||
| 68 | let crate_name = codegen_results.crate_info.local_crate_name; | 69 | let crate_name = crate_info.local_crate_name; |
| 69 | for &crate_type in sess.opts.crate_types.iter() { | 70 | for &crate_type in sess.opts.crate_types.iter() { |
| 70 | if crate_type != CrateType::Rlib { | 71 | if crate_type != CrateType::Rlib { |
| 71 | sess.dcx().fatal(format!("Crate type is {:?}", crate_type)); | 72 | sess.dcx().fatal(format!("Crate type is {:?}", crate_type)); |
tests/ui/README.md+5| ... | @@ -705,6 +705,11 @@ This test category revolves around trait objects with `Sized` having illegal ope | ... | @@ -705,6 +705,11 @@ This test category revolves around trait objects with `Sized` having illegal ope |
| 705 | 705 | ||
| 706 | Tests on lifetime elision in impl function signatures. See [Lifetime elision | Nomicon](https://doc.rust-lang.org/nomicon/lifetime-elision.html). | 706 | Tests on lifetime elision in impl function signatures. See [Lifetime elision | Nomicon](https://doc.rust-lang.org/nomicon/lifetime-elision.html). |
| 707 | 707 | ||
| 708 | ## `tests/ui/impl-restriction/` | ||
| 709 | Tests for `#![feature(impl_restriction)]`. See [Tracking issue for restrictions #105077 | ||
| 710 | ](https://github.com/rust-lang/rust/issues/105077). | ||
| 711 | |||
| 712 | |||
| 708 | ## `tests/ui/impl-trait/` | 713 | ## `tests/ui/impl-trait/` |
| 709 | 714 | ||
| 710 | Tests for trait impls. | 715 | Tests for trait impls. |
tests/ui/associated-types/defaults-in-other-trait-items.rs+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | #![feature(associated_type_defaults)] | 1 | #![feature(associated_type_defaults)] |
| 2 | 2 | ||
| 3 | // Associated type defaults may not be assumed inside the trait defining them. | 3 | // Associated type defaults may not be assumed inside the trait defining them. |
| 4 | // ie. they only resolve to `<Self as Tr>::A`, not the actual type `()` | 4 | // i.e. they only resolve to `<Self as Tr>::A`, not the actual type `()` |
| 5 | trait Tr { | 5 | trait Tr { |
| 6 | type A = (); //~ NOTE associated type defaults can't be assumed inside the trait defining them | 6 | type A = (); //~ NOTE associated type defaults can't be assumed inside the trait defining them |
| 7 | 7 |
tests/ui/associated-types/issue-54182-1.rs+1-1| ... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
| 3 | // Tests that the return type of trait methods is correctly normalized when | 3 | // Tests that the return type of trait methods is correctly normalized when |
| 4 | // checking that a method in an impl matches the trait definition when the | 4 | // checking that a method in an impl matches the trait definition when the |
| 5 | // return type involves a defaulted associated type. | 5 | // return type involves a defaulted associated type. |
| 6 | // ie. the trait has a method with return type `-> Self::R`, and `type R = ()`, | 6 | // i.e. the trait has a method with return type `-> Self::R`, and `type R = ()`, |
| 7 | // but the impl leaves out the return type (resulting in `()`). | 7 | // but the impl leaves out the return type (resulting in `()`). |
| 8 | // Note that specialization is not involved in this test; no items in | 8 | // Note that specialization is not involved in this test; no items in |
| 9 | // implementations may be overridden. If they were, the normalization wouldn't | 9 | // implementations may be overridden. If they were, the normalization wouldn't |
tests/ui/impl-restriction/feature-gate-impl-restriction.rs created+43| ... | @@ -0,0 +1,43 @@ | ||
| 1 | //@ compile-flags: --crate-type=lib | ||
| 2 | //@ revisions: with_gate without_gate | ||
| 3 | //@[with_gate] check-pass | ||
| 4 | |||
| 5 | #![cfg_attr(with_gate, feature(impl_restriction))] | ||
| 6 | #![cfg_attr(with_gate, allow(incomplete_features))] | ||
| 7 | #![feature(auto_traits, const_trait_impl)] | ||
| 8 | |||
| 9 | pub impl(crate) trait Bar {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 10 | pub impl(in crate) trait BarInCrate {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 11 | |||
| 12 | mod foo { | ||
| 13 | pub impl(in crate::foo) trait Baz {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 14 | pub unsafe impl(super) trait BazUnsafeSuper {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 15 | pub auto impl(self) trait BazAutoSelf {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 16 | pub const impl(in self) trait BazConst {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 17 | |||
| 18 | mod foo_inner { | ||
| 19 | pub impl(in crate::foo::foo_inner) trait Qux {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 20 | pub unsafe auto impl(in crate::foo::foo_inner) trait QuxAutoUnsafe {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 21 | pub const unsafe impl(in crate::foo::foo_inner) trait QuxConstUnsafe {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 22 | } | ||
| 23 | |||
| 24 | #[cfg(false)] | ||
| 25 | pub impl(crate) trait Bar {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 26 | #[cfg(false)] | ||
| 27 | pub impl(in crate) trait BarInCrate {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 28 | #[cfg(false)] | ||
| 29 | pub unsafe impl(self) trait BazUnsafeSelf {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 30 | #[cfg(false)] | ||
| 31 | pub auto impl(in super) trait BazAutoSuper {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 32 | #[cfg(false)] | ||
| 33 | pub const impl(super) trait BazConstSuper {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 34 | |||
| 35 | #[cfg(false)] | ||
| 36 | mod cfged_out_foo { | ||
| 37 | pub impl(in crate::foo::cfged_out_foo) trait CfgedOutQux {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 38 | pub unsafe auto impl(in crate::foo::cfged_out_foo) trait CfgedOutQuxUnsafeAuto {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 39 | pub const unsafe impl(in crate::foo::cfged_out_foo) trait CfgedOutQuxConstUnsafe {} //[without_gate]~ ERROR `impl` restrictions are experimental | ||
| 40 | } | ||
| 41 | |||
| 42 | // auto traits cannot be const, so we do not include these combinations in the test. | ||
| 43 | } | ||
tests/ui/impl-restriction/feature-gate-impl-restriction.without_gate.stderr created+173| ... | @@ -0,0 +1,173 @@ | ||
| 1 | error[E0658]: `impl` restrictions are experimental | ||
| 2 | --> $DIR/feature-gate-impl-restriction.rs:9:5 | ||
| 3 | | | ||
| 4 | LL | pub impl(crate) trait Bar {} | ||
| 5 | | ^^^^^^^^^^^ | ||
| 6 | | | ||
| 7 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 8 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 10 | |||
| 11 | error[E0658]: `impl` restrictions are experimental | ||
| 12 | --> $DIR/feature-gate-impl-restriction.rs:10:5 | ||
| 13 | | | ||
| 14 | LL | pub impl(in crate) trait BarInCrate {} | ||
| 15 | | ^^^^^^^^^^^^^^ | ||
| 16 | | | ||
| 17 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 18 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 19 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 20 | |||
| 21 | error[E0658]: `impl` restrictions are experimental | ||
| 22 | --> $DIR/feature-gate-impl-restriction.rs:13:9 | ||
| 23 | | | ||
| 24 | LL | pub impl(in crate::foo) trait Baz {} | ||
| 25 | | ^^^^^^^^^^^^^^^^^^^ | ||
| 26 | | | ||
| 27 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 28 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 29 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 30 | |||
| 31 | error[E0658]: `impl` restrictions are experimental | ||
| 32 | --> $DIR/feature-gate-impl-restriction.rs:14:16 | ||
| 33 | | | ||
| 34 | LL | pub unsafe impl(super) trait BazUnsafeSuper {} | ||
| 35 | | ^^^^^^^^^^^ | ||
| 36 | | | ||
| 37 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 38 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 39 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 40 | |||
| 41 | error[E0658]: `impl` restrictions are experimental | ||
| 42 | --> $DIR/feature-gate-impl-restriction.rs:15:14 | ||
| 43 | | | ||
| 44 | LL | pub auto impl(self) trait BazAutoSelf {} | ||
| 45 | | ^^^^^^^^^^ | ||
| 46 | | | ||
| 47 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 48 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 49 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 50 | |||
| 51 | error[E0658]: `impl` restrictions are experimental | ||
| 52 | --> $DIR/feature-gate-impl-restriction.rs:16:15 | ||
| 53 | | | ||
| 54 | LL | pub const impl(in self) trait BazConst {} | ||
| 55 | | ^^^^^^^^^^^^^ | ||
| 56 | | | ||
| 57 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 58 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 59 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 60 | |||
| 61 | error[E0658]: `impl` restrictions are experimental | ||
| 62 | --> $DIR/feature-gate-impl-restriction.rs:19:13 | ||
| 63 | | | ||
| 64 | LL | pub impl(in crate::foo::foo_inner) trait Qux {} | ||
| 65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 66 | | | ||
| 67 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 68 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 69 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 70 | |||
| 71 | error[E0658]: `impl` restrictions are experimental | ||
| 72 | --> $DIR/feature-gate-impl-restriction.rs:20:25 | ||
| 73 | | | ||
| 74 | LL | ... pub unsafe auto impl(in crate::foo::foo_inner) trait QuxAutoUnsafe {} | ||
| 75 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 76 | | | ||
| 77 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 78 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 79 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 80 | |||
| 81 | error[E0658]: `impl` restrictions are experimental | ||
| 82 | --> $DIR/feature-gate-impl-restriction.rs:21:26 | ||
| 83 | | | ||
| 84 | LL | ... pub const unsafe impl(in crate::foo::foo_inner) trait QuxConstUnsafe {} | ||
| 85 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 86 | | | ||
| 87 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 88 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 89 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 90 | |||
| 91 | error[E0658]: `impl` restrictions are experimental | ||
| 92 | --> $DIR/feature-gate-impl-restriction.rs:25:9 | ||
| 93 | | | ||
| 94 | LL | pub impl(crate) trait Bar {} | ||
| 95 | | ^^^^^^^^^^^ | ||
| 96 | | | ||
| 97 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 98 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 99 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 100 | |||
| 101 | error[E0658]: `impl` restrictions are experimental | ||
| 102 | --> $DIR/feature-gate-impl-restriction.rs:27:9 | ||
| 103 | | | ||
| 104 | LL | pub impl(in crate) trait BarInCrate {} | ||
| 105 | | ^^^^^^^^^^^^^^ | ||
| 106 | | | ||
| 107 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 108 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 109 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 110 | |||
| 111 | error[E0658]: `impl` restrictions are experimental | ||
| 112 | --> $DIR/feature-gate-impl-restriction.rs:29:16 | ||
| 113 | | | ||
| 114 | LL | pub unsafe impl(self) trait BazUnsafeSelf {} | ||
| 115 | | ^^^^^^^^^^ | ||
| 116 | | | ||
| 117 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 118 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 119 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 120 | |||
| 121 | error[E0658]: `impl` restrictions are experimental | ||
| 122 | --> $DIR/feature-gate-impl-restriction.rs:31:14 | ||
| 123 | | | ||
| 124 | LL | pub auto impl(in super) trait BazAutoSuper {} | ||
| 125 | | ^^^^^^^^^^^^^^ | ||
| 126 | | | ||
| 127 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 128 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 129 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 130 | |||
| 131 | error[E0658]: `impl` restrictions are experimental | ||
| 132 | --> $DIR/feature-gate-impl-restriction.rs:33:15 | ||
| 133 | | | ||
| 134 | LL | pub const impl(super) trait BazConstSuper {} | ||
| 135 | | ^^^^^^^^^^^ | ||
| 136 | | | ||
| 137 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 138 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 139 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 140 | |||
| 141 | error[E0658]: `impl` restrictions are experimental | ||
| 142 | --> $DIR/feature-gate-impl-restriction.rs:37:13 | ||
| 143 | | | ||
| 144 | LL | pub impl(in crate::foo::cfged_out_foo) trait CfgedOutQux {} | ||
| 145 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 146 | | | ||
| 147 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 148 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 149 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 150 | |||
| 151 | error[E0658]: `impl` restrictions are experimental | ||
| 152 | --> $DIR/feature-gate-impl-restriction.rs:38:25 | ||
| 153 | | | ||
| 154 | LL | ... pub unsafe auto impl(in crate::foo::cfged_out_foo) trait CfgedOutQuxUnsafeAuto {} | ||
| 155 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 156 | | | ||
| 157 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 158 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 159 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 160 | |||
| 161 | error[E0658]: `impl` restrictions are experimental | ||
| 162 | --> $DIR/feature-gate-impl-restriction.rs:39:26 | ||
| 163 | | | ||
| 164 | LL | ... pub const unsafe impl(in crate::foo::cfged_out_foo) trait CfgedOutQuxConstUnsafe {} | ||
| 165 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 166 | | | ||
| 167 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 168 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 169 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 170 | |||
| 171 | error: aborting due to 17 previous errors | ||
| 172 | |||
| 173 | For more information about this error, try `rustc --explain E0658`. | ||
tests/ui/impl-restriction/recover-incorrect-impl-restriction.rs created+20| ... | @@ -0,0 +1,20 @@ | ||
| 1 | //@ compile-flags: --crate-type=lib | ||
| 2 | //@ revisions: with_gate without_gate | ||
| 3 | #![cfg_attr(with_gate, feature(impl_restriction))] | ||
| 4 | //[with_gate]~^ WARN the feature `impl_restriction` is incomplete and may not be safe to use and/or cause compiler crashes | ||
| 5 | #![feature(auto_traits, const_trait_impl)] | ||
| 6 | |||
| 7 | mod foo { | ||
| 8 | pub impl(crate::foo) trait Baz {} //~ ERROR incorrect `impl` restriction | ||
| 9 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 10 | pub unsafe impl(crate::foo) trait BazUnsafe {} //~ ERROR incorrect `impl` restriction | ||
| 11 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 12 | pub auto impl(crate::foo) trait BazAuto {} //~ ERROR incorrect `impl` restriction | ||
| 13 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 14 | pub const impl(crate::foo) trait BazConst {} //~ ERROR incorrect `impl` restriction | ||
| 15 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 16 | pub const unsafe impl(crate::foo) trait BazConstUnsafe {} //~ ERROR incorrect `impl` restriction | ||
| 17 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 18 | pub unsafe auto impl(crate::foo) trait BazUnsafeAuto {} //~ ERROR incorrect `impl` restriction | ||
| 19 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 20 | } | ||
tests/ui/impl-restriction/recover-incorrect-impl-restriction.with_gate.stderr created+107| ... | @@ -0,0 +1,107 @@ | ||
| 1 | error: incorrect `impl` restriction | ||
| 2 | --> $DIR/recover-incorrect-impl-restriction.rs:8:14 | ||
| 3 | | | ||
| 4 | LL | pub impl(crate::foo) trait Baz {} | ||
| 5 | | ^^^^^^^^^^ | ||
| 6 | | | ||
| 7 | = help: some possible `impl` restrictions are: | ||
| 8 | `impl(crate)`: can only be implemented in the current crate | ||
| 9 | `impl(super)`: can only be implemented in the parent module | ||
| 10 | `impl(self)`: can only be implemented in current module | ||
| 11 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 12 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 13 | | | ||
| 14 | LL | pub impl(in crate::foo) trait Baz {} | ||
| 15 | | ++ | ||
| 16 | |||
| 17 | error: incorrect `impl` restriction | ||
| 18 | --> $DIR/recover-incorrect-impl-restriction.rs:10:21 | ||
| 19 | | | ||
| 20 | LL | pub unsafe impl(crate::foo) trait BazUnsafe {} | ||
| 21 | | ^^^^^^^^^^ | ||
| 22 | | | ||
| 23 | = help: some possible `impl` restrictions are: | ||
| 24 | `impl(crate)`: can only be implemented in the current crate | ||
| 25 | `impl(super)`: can only be implemented in the parent module | ||
| 26 | `impl(self)`: can only be implemented in current module | ||
| 27 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 28 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 29 | | | ||
| 30 | LL | pub unsafe impl(in crate::foo) trait BazUnsafe {} | ||
| 31 | | ++ | ||
| 32 | |||
| 33 | error: incorrect `impl` restriction | ||
| 34 | --> $DIR/recover-incorrect-impl-restriction.rs:12:19 | ||
| 35 | | | ||
| 36 | LL | pub auto impl(crate::foo) trait BazAuto {} | ||
| 37 | | ^^^^^^^^^^ | ||
| 38 | | | ||
| 39 | = help: some possible `impl` restrictions are: | ||
| 40 | `impl(crate)`: can only be implemented in the current crate | ||
| 41 | `impl(super)`: can only be implemented in the parent module | ||
| 42 | `impl(self)`: can only be implemented in current module | ||
| 43 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 44 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 45 | | | ||
| 46 | LL | pub auto impl(in crate::foo) trait BazAuto {} | ||
| 47 | | ++ | ||
| 48 | |||
| 49 | error: incorrect `impl` restriction | ||
| 50 | --> $DIR/recover-incorrect-impl-restriction.rs:14:20 | ||
| 51 | | | ||
| 52 | LL | pub const impl(crate::foo) trait BazConst {} | ||
| 53 | | ^^^^^^^^^^ | ||
| 54 | | | ||
| 55 | = help: some possible `impl` restrictions are: | ||
| 56 | `impl(crate)`: can only be implemented in the current crate | ||
| 57 | `impl(super)`: can only be implemented in the parent module | ||
| 58 | `impl(self)`: can only be implemented in current module | ||
| 59 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 60 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 61 | | | ||
| 62 | LL | pub const impl(in crate::foo) trait BazConst {} | ||
| 63 | | ++ | ||
| 64 | |||
| 65 | error: incorrect `impl` restriction | ||
| 66 | --> $DIR/recover-incorrect-impl-restriction.rs:16:27 | ||
| 67 | | | ||
| 68 | LL | pub const unsafe impl(crate::foo) trait BazConstUnsafe {} | ||
| 69 | | ^^^^^^^^^^ | ||
| 70 | | | ||
| 71 | = help: some possible `impl` restrictions are: | ||
| 72 | `impl(crate)`: can only be implemented in the current crate | ||
| 73 | `impl(super)`: can only be implemented in the parent module | ||
| 74 | `impl(self)`: can only be implemented in current module | ||
| 75 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 76 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 77 | | | ||
| 78 | LL | pub const unsafe impl(in crate::foo) trait BazConstUnsafe {} | ||
| 79 | | ++ | ||
| 80 | |||
| 81 | error: incorrect `impl` restriction | ||
| 82 | --> $DIR/recover-incorrect-impl-restriction.rs:18:26 | ||
| 83 | | | ||
| 84 | LL | pub unsafe auto impl(crate::foo) trait BazUnsafeAuto {} | ||
| 85 | | ^^^^^^^^^^ | ||
| 86 | | | ||
| 87 | = help: some possible `impl` restrictions are: | ||
| 88 | `impl(crate)`: can only be implemented in the current crate | ||
| 89 | `impl(super)`: can only be implemented in the parent module | ||
| 90 | `impl(self)`: can only be implemented in current module | ||
| 91 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 92 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 93 | | | ||
| 94 | LL | pub unsafe auto impl(in crate::foo) trait BazUnsafeAuto {} | ||
| 95 | | ++ | ||
| 96 | |||
| 97 | warning: the feature `impl_restriction` is incomplete and may not be safe to use and/or cause compiler crashes | ||
| 98 | --> $DIR/recover-incorrect-impl-restriction.rs:3:32 | ||
| 99 | | | ||
| 100 | LL | #![cfg_attr(with_gate, feature(impl_restriction))] | ||
| 101 | | ^^^^^^^^^^^^^^^^ | ||
| 102 | | | ||
| 103 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 104 | = note: `#[warn(incomplete_features)]` on by default | ||
| 105 | |||
| 106 | error: aborting due to 6 previous errors; 1 warning emitted | ||
| 107 | |||
tests/ui/impl-restriction/recover-incorrect-impl-restriction.without_gate.stderr created+159| ... | @@ -0,0 +1,159 @@ | ||
| 1 | error: incorrect `impl` restriction | ||
| 2 | --> $DIR/recover-incorrect-impl-restriction.rs:8:14 | ||
| 3 | | | ||
| 4 | LL | pub impl(crate::foo) trait Baz {} | ||
| 5 | | ^^^^^^^^^^ | ||
| 6 | | | ||
| 7 | = help: some possible `impl` restrictions are: | ||
| 8 | `impl(crate)`: can only be implemented in the current crate | ||
| 9 | `impl(super)`: can only be implemented in the parent module | ||
| 10 | `impl(self)`: can only be implemented in current module | ||
| 11 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 12 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 13 | | | ||
| 14 | LL | pub impl(in crate::foo) trait Baz {} | ||
| 15 | | ++ | ||
| 16 | |||
| 17 | error: incorrect `impl` restriction | ||
| 18 | --> $DIR/recover-incorrect-impl-restriction.rs:10:21 | ||
| 19 | | | ||
| 20 | LL | pub unsafe impl(crate::foo) trait BazUnsafe {} | ||
| 21 | | ^^^^^^^^^^ | ||
| 22 | | | ||
| 23 | = help: some possible `impl` restrictions are: | ||
| 24 | `impl(crate)`: can only be implemented in the current crate | ||
| 25 | `impl(super)`: can only be implemented in the parent module | ||
| 26 | `impl(self)`: can only be implemented in current module | ||
| 27 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 28 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 29 | | | ||
| 30 | LL | pub unsafe impl(in crate::foo) trait BazUnsafe {} | ||
| 31 | | ++ | ||
| 32 | |||
| 33 | error: incorrect `impl` restriction | ||
| 34 | --> $DIR/recover-incorrect-impl-restriction.rs:12:19 | ||
| 35 | | | ||
| 36 | LL | pub auto impl(crate::foo) trait BazAuto {} | ||
| 37 | | ^^^^^^^^^^ | ||
| 38 | | | ||
| 39 | = help: some possible `impl` restrictions are: | ||
| 40 | `impl(crate)`: can only be implemented in the current crate | ||
| 41 | `impl(super)`: can only be implemented in the parent module | ||
| 42 | `impl(self)`: can only be implemented in current module | ||
| 43 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 44 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 45 | | | ||
| 46 | LL | pub auto impl(in crate::foo) trait BazAuto {} | ||
| 47 | | ++ | ||
| 48 | |||
| 49 | error: incorrect `impl` restriction | ||
| 50 | --> $DIR/recover-incorrect-impl-restriction.rs:14:20 | ||
| 51 | | | ||
| 52 | LL | pub const impl(crate::foo) trait BazConst {} | ||
| 53 | | ^^^^^^^^^^ | ||
| 54 | | | ||
| 55 | = help: some possible `impl` restrictions are: | ||
| 56 | `impl(crate)`: can only be implemented in the current crate | ||
| 57 | `impl(super)`: can only be implemented in the parent module | ||
| 58 | `impl(self)`: can only be implemented in current module | ||
| 59 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 60 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 61 | | | ||
| 62 | LL | pub const impl(in crate::foo) trait BazConst {} | ||
| 63 | | ++ | ||
| 64 | |||
| 65 | error: incorrect `impl` restriction | ||
| 66 | --> $DIR/recover-incorrect-impl-restriction.rs:16:27 | ||
| 67 | | | ||
| 68 | LL | pub const unsafe impl(crate::foo) trait BazConstUnsafe {} | ||
| 69 | | ^^^^^^^^^^ | ||
| 70 | | | ||
| 71 | = help: some possible `impl` restrictions are: | ||
| 72 | `impl(crate)`: can only be implemented in the current crate | ||
| 73 | `impl(super)`: can only be implemented in the parent module | ||
| 74 | `impl(self)`: can only be implemented in current module | ||
| 75 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 76 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 77 | | | ||
| 78 | LL | pub const unsafe impl(in crate::foo) trait BazConstUnsafe {} | ||
| 79 | | ++ | ||
| 80 | |||
| 81 | error: incorrect `impl` restriction | ||
| 82 | --> $DIR/recover-incorrect-impl-restriction.rs:18:26 | ||
| 83 | | | ||
| 84 | LL | pub unsafe auto impl(crate::foo) trait BazUnsafeAuto {} | ||
| 85 | | ^^^^^^^^^^ | ||
| 86 | | | ||
| 87 | = help: some possible `impl` restrictions are: | ||
| 88 | `impl(crate)`: can only be implemented in the current crate | ||
| 89 | `impl(super)`: can only be implemented in the parent module | ||
| 90 | `impl(self)`: can only be implemented in current module | ||
| 91 | `impl(in path::to::module)`: can only be implemented in the specified path | ||
| 92 | help: help: use `in` to restrict implementations to the path `crate::foo` | ||
| 93 | | | ||
| 94 | LL | pub unsafe auto impl(in crate::foo) trait BazUnsafeAuto {} | ||
| 95 | | ++ | ||
| 96 | |||
| 97 | error[E0658]: `impl` restrictions are experimental | ||
| 98 | --> $DIR/recover-incorrect-impl-restriction.rs:8:9 | ||
| 99 | | | ||
| 100 | LL | pub impl(crate::foo) trait Baz {} | ||
| 101 | | ^^^^^^^^^^^^^^^^ | ||
| 102 | | | ||
| 103 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 104 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 105 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 106 | |||
| 107 | error[E0658]: `impl` restrictions are experimental | ||
| 108 | --> $DIR/recover-incorrect-impl-restriction.rs:10:16 | ||
| 109 | | | ||
| 110 | LL | pub unsafe impl(crate::foo) trait BazUnsafe {} | ||
| 111 | | ^^^^^^^^^^^^^^^^ | ||
| 112 | | | ||
| 113 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 114 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 115 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 116 | |||
| 117 | error[E0658]: `impl` restrictions are experimental | ||
| 118 | --> $DIR/recover-incorrect-impl-restriction.rs:12:14 | ||
| 119 | | | ||
| 120 | LL | pub auto impl(crate::foo) trait BazAuto {} | ||
| 121 | | ^^^^^^^^^^^^^^^^ | ||
| 122 | | | ||
| 123 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 124 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 125 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 126 | |||
| 127 | error[E0658]: `impl` restrictions are experimental | ||
| 128 | --> $DIR/recover-incorrect-impl-restriction.rs:14:15 | ||
| 129 | | | ||
| 130 | LL | pub const impl(crate::foo) trait BazConst {} | ||
| 131 | | ^^^^^^^^^^^^^^^^ | ||
| 132 | | | ||
| 133 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 134 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 135 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 136 | |||
| 137 | error[E0658]: `impl` restrictions are experimental | ||
| 138 | --> $DIR/recover-incorrect-impl-restriction.rs:16:22 | ||
| 139 | | | ||
| 140 | LL | pub const unsafe impl(crate::foo) trait BazConstUnsafe {} | ||
| 141 | | ^^^^^^^^^^^^^^^^ | ||
| 142 | | | ||
| 143 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 144 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 145 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 146 | |||
| 147 | error[E0658]: `impl` restrictions are experimental | ||
| 148 | --> $DIR/recover-incorrect-impl-restriction.rs:18:21 | ||
| 149 | | | ||
| 150 | LL | pub unsafe auto impl(crate::foo) trait BazUnsafeAuto {} | ||
| 151 | | ^^^^^^^^^^^^^^^^ | ||
| 152 | | | ||
| 153 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 154 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 155 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 156 | |||
| 157 | error: aborting due to 12 previous errors | ||
| 158 | |||
| 159 | For more information about this error, try `rustc --explain E0658`. | ||
tests/ui/impl-restriction/trait-alias-cannot-be-impl-restricted.rs created+28| ... | @@ -0,0 +1,28 @@ | ||
| 1 | //@ compile-flags: --crate-type=lib | ||
| 2 | //@ revisions: with_gate without_gate | ||
| 3 | #![cfg_attr(with_gate, feature(impl_restriction))] | ||
| 4 | //[with_gate]~^ WARN the feature `impl_restriction` is incomplete and may not be safe to use and/or cause compiler crashes | ||
| 5 | #![feature(auto_traits, const_trait_impl, trait_alias)] | ||
| 6 | |||
| 7 | impl(crate) trait Alias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 8 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 9 | auto impl(in crate) trait AutoAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 10 | //~^ ERROR trait aliases cannot be `auto` | ||
| 11 | //[without_gate]~| ERROR `impl` restrictions are experimental | ||
| 12 | unsafe impl(self) trait UnsafeAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 13 | //~^ ERROR trait aliases cannot be `unsafe` | ||
| 14 | //[without_gate]~| ERROR `impl` restrictions are experimental | ||
| 15 | const impl(in self) trait ConstAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 16 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 17 | |||
| 18 | mod foo { | ||
| 19 | impl(super) trait InnerAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 20 | //[without_gate]~^ ERROR `impl` restrictions are experimental | ||
| 21 | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 22 | //~^ ERROR trait aliases cannot be `unsafe` | ||
| 23 | //[without_gate]~| ERROR `impl` restrictions are experimental | ||
| 24 | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; //~ ERROR trait aliases cannot be `impl`-restricted | ||
| 25 | //~^ ERROR trait aliases cannot be `auto` | ||
| 26 | //~^^ ERROR trait aliases cannot be `unsafe` | ||
| 27 | //[without_gate]~| ERROR `impl` restrictions are experimental | ||
| 28 | } | ||
tests/ui/impl-restriction/trait-alias-cannot-be-impl-restricted.with_gate.stderr created+83| ... | @@ -0,0 +1,83 @@ | ||
| 1 | error: trait aliases cannot be `impl`-restricted | ||
| 2 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:7:1 | ||
| 3 | | | ||
| 4 | LL | impl(crate) trait Alias = Copy; | ||
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 6 | |||
| 7 | error: trait aliases cannot be `auto` | ||
| 8 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:9:1 | ||
| 9 | | | ||
| 10 | LL | auto impl(in crate) trait AutoAlias = Copy; | ||
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `auto` | ||
| 12 | |||
| 13 | error: trait aliases cannot be `impl`-restricted | ||
| 14 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:9:1 | ||
| 15 | | | ||
| 16 | LL | auto impl(in crate) trait AutoAlias = Copy; | ||
| 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 18 | |||
| 19 | error: trait aliases cannot be `unsafe` | ||
| 20 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:12:1 | ||
| 21 | | | ||
| 22 | LL | unsafe impl(self) trait UnsafeAlias = Copy; | ||
| 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 24 | |||
| 25 | error: trait aliases cannot be `impl`-restricted | ||
| 26 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:12:1 | ||
| 27 | | | ||
| 28 | LL | unsafe impl(self) trait UnsafeAlias = Copy; | ||
| 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 30 | |||
| 31 | error: trait aliases cannot be `impl`-restricted | ||
| 32 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:15:1 | ||
| 33 | | | ||
| 34 | LL | const impl(in self) trait ConstAlias = Copy; | ||
| 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 36 | |||
| 37 | error: trait aliases cannot be `impl`-restricted | ||
| 38 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:19:5 | ||
| 39 | | | ||
| 40 | LL | impl(super) trait InnerAlias = Copy; | ||
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 42 | |||
| 43 | error: trait aliases cannot be `unsafe` | ||
| 44 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:21:5 | ||
| 45 | | | ||
| 46 | LL | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; | ||
| 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 48 | |||
| 49 | error: trait aliases cannot be `impl`-restricted | ||
| 50 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:21:5 | ||
| 51 | | | ||
| 52 | LL | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; | ||
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 54 | |||
| 55 | error: trait aliases cannot be `auto` | ||
| 56 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 57 | | | ||
| 58 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `auto` | ||
| 60 | |||
| 61 | error: trait aliases cannot be `unsafe` | ||
| 62 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 63 | | | ||
| 64 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 66 | |||
| 67 | error: trait aliases cannot be `impl`-restricted | ||
| 68 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 69 | | | ||
| 70 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 71 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 72 | |||
| 73 | warning: the feature `impl_restriction` is incomplete and may not be safe to use and/or cause compiler crashes | ||
| 74 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:3:32 | ||
| 75 | | | ||
| 76 | LL | #![cfg_attr(with_gate, feature(impl_restriction))] | ||
| 77 | | ^^^^^^^^^^^^^^^^ | ||
| 78 | | | ||
| 79 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 80 | = note: `#[warn(incomplete_features)]` on by default | ||
| 81 | |||
| 82 | error: aborting due to 12 previous errors; 1 warning emitted | ||
| 83 | |||
tests/ui/impl-restriction/trait-alias-cannot-be-impl-restricted.without_gate.stderr created+145| ... | @@ -0,0 +1,145 @@ | ||
| 1 | error: trait aliases cannot be `impl`-restricted | ||
| 2 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:7:1 | ||
| 3 | | | ||
| 4 | LL | impl(crate) trait Alias = Copy; | ||
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 6 | |||
| 7 | error: trait aliases cannot be `auto` | ||
| 8 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:9:1 | ||
| 9 | | | ||
| 10 | LL | auto impl(in crate) trait AutoAlias = Copy; | ||
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `auto` | ||
| 12 | |||
| 13 | error: trait aliases cannot be `impl`-restricted | ||
| 14 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:9:1 | ||
| 15 | | | ||
| 16 | LL | auto impl(in crate) trait AutoAlias = Copy; | ||
| 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 18 | |||
| 19 | error: trait aliases cannot be `unsafe` | ||
| 20 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:12:1 | ||
| 21 | | | ||
| 22 | LL | unsafe impl(self) trait UnsafeAlias = Copy; | ||
| 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 24 | |||
| 25 | error: trait aliases cannot be `impl`-restricted | ||
| 26 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:12:1 | ||
| 27 | | | ||
| 28 | LL | unsafe impl(self) trait UnsafeAlias = Copy; | ||
| 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 30 | |||
| 31 | error: trait aliases cannot be `impl`-restricted | ||
| 32 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:15:1 | ||
| 33 | | | ||
| 34 | LL | const impl(in self) trait ConstAlias = Copy; | ||
| 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 36 | |||
| 37 | error: trait aliases cannot be `impl`-restricted | ||
| 38 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:19:5 | ||
| 39 | | | ||
| 40 | LL | impl(super) trait InnerAlias = Copy; | ||
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 42 | |||
| 43 | error: trait aliases cannot be `unsafe` | ||
| 44 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:21:5 | ||
| 45 | | | ||
| 46 | LL | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; | ||
| 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 48 | |||
| 49 | error: trait aliases cannot be `impl`-restricted | ||
| 50 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:21:5 | ||
| 51 | | | ||
| 52 | LL | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; | ||
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 54 | |||
| 55 | error: trait aliases cannot be `auto` | ||
| 56 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 57 | | | ||
| 58 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `auto` | ||
| 60 | |||
| 61 | error: trait aliases cannot be `unsafe` | ||
| 62 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 63 | | | ||
| 64 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` | ||
| 66 | |||
| 67 | error: trait aliases cannot be `impl`-restricted | ||
| 68 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:5 | ||
| 69 | | | ||
| 70 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 71 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `impl`-restricted | ||
| 72 | |||
| 73 | error[E0658]: `impl` restrictions are experimental | ||
| 74 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:7:1 | ||
| 75 | | | ||
| 76 | LL | impl(crate) trait Alias = Copy; | ||
| 77 | | ^^^^^^^^^^^ | ||
| 78 | | | ||
| 79 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 80 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 81 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 82 | |||
| 83 | error[E0658]: `impl` restrictions are experimental | ||
| 84 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:9:6 | ||
| 85 | | | ||
| 86 | LL | auto impl(in crate) trait AutoAlias = Copy; | ||
| 87 | | ^^^^^^^^^^^^^^ | ||
| 88 | | | ||
| 89 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 90 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 91 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 92 | |||
| 93 | error[E0658]: `impl` restrictions are experimental | ||
| 94 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:12:8 | ||
| 95 | | | ||
| 96 | LL | unsafe impl(self) trait UnsafeAlias = Copy; | ||
| 97 | | ^^^^^^^^^^ | ||
| 98 | | | ||
| 99 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 100 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 101 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 102 | |||
| 103 | error[E0658]: `impl` restrictions are experimental | ||
| 104 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:15:7 | ||
| 105 | | | ||
| 106 | LL | const impl(in self) trait ConstAlias = Copy; | ||
| 107 | | ^^^^^^^^^^^^^ | ||
| 108 | | | ||
| 109 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 110 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 111 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 112 | |||
| 113 | error[E0658]: `impl` restrictions are experimental | ||
| 114 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:19:5 | ||
| 115 | | | ||
| 116 | LL | impl(super) trait InnerAlias = Copy; | ||
| 117 | | ^^^^^^^^^^^ | ||
| 118 | | | ||
| 119 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 120 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 121 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 122 | |||
| 123 | error[E0658]: `impl` restrictions are experimental | ||
| 124 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:21:18 | ||
| 125 | | | ||
| 126 | LL | const unsafe impl(in crate::foo) trait InnerConstUnsafeAlias = Copy; | ||
| 127 | | ^^^^^^^^^^^^^^^^^^^ | ||
| 128 | | | ||
| 129 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 130 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 131 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 132 | |||
| 133 | error[E0658]: `impl` restrictions are experimental | ||
| 134 | --> $DIR/trait-alias-cannot-be-impl-restricted.rs:24:17 | ||
| 135 | | | ||
| 136 | LL | unsafe auto impl(in crate::foo) trait InnerUnsafeAutoAlias = Copy; | ||
| 137 | | ^^^^^^^^^^^^^^^^^^^ | ||
| 138 | | | ||
| 139 | = note: see issue #105077 <https://github.com/rust-lang/rust/issues/105077> for more information | ||
| 140 | = help: add `#![feature(impl_restriction)]` to the crate attributes to enable | ||
| 141 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
| 142 | |||
| 143 | error: aborting due to 19 previous errors | ||
| 144 | |||
| 145 | For more information about this error, try `rustc --explain E0658`. | ||
tests/ui/macros/stringify.rs+105| ... | @@ -800,6 +800,111 @@ macro_rules! p { | ... | @@ -800,6 +800,111 @@ macro_rules! p { |
| 800 | }; | 800 | }; |
| 801 | } | 801 | } |
| 802 | 802 | ||
| 803 | #[test] | ||
| 804 | fn test_impl_restriction() { | ||
| 805 | assert_eq!( | ||
| 806 | stringify!(pub impl(crate) trait Foo {}), | ||
| 807 | "pub impl(crate) trait Foo {}" | ||
| 808 | ); | ||
| 809 | assert_eq!( | ||
| 810 | stringify!(pub impl(in crate) trait Foo {}), | ||
| 811 | "pub impl(in crate) trait Foo {}" | ||
| 812 | ); | ||
| 813 | assert_eq!( | ||
| 814 | stringify!(pub impl(super) trait Foo {}), | ||
| 815 | "pub impl(super) trait Foo {}" | ||
| 816 | ); | ||
| 817 | assert_eq!( | ||
| 818 | stringify!(pub impl(in super) trait Foo {}), | ||
| 819 | "pub impl(in super) trait Foo {}" | ||
| 820 | ); | ||
| 821 | assert_eq!( | ||
| 822 | stringify!(pub impl(self) trait Foo {}), | ||
| 823 | "pub impl(self) trait Foo {}" | ||
| 824 | ); | ||
| 825 | assert_eq!( | ||
| 826 | stringify!(pub impl(in self) trait Foo {}), | ||
| 827 | "pub impl(in self) trait Foo {}" | ||
| 828 | ); | ||
| 829 | assert_eq!( | ||
| 830 | stringify!(pub impl(in path::to) trait Foo {}), | ||
| 831 | "pub impl(in path::to) trait Foo {}" | ||
| 832 | ); | ||
| 833 | assert_eq!( | ||
| 834 | stringify!(pub impl(in ::path::to) trait Foo {}), | ||
| 835 | "pub impl(in ::path::to) trait Foo {}" | ||
| 836 | ); | ||
| 837 | assert_eq!( | ||
| 838 | stringify!(pub impl(in self::path::to) trait Foo {}), | ||
| 839 | "pub impl(in self::path::to) trait Foo {}" | ||
| 840 | ); | ||
| 841 | assert_eq!( | ||
| 842 | stringify!(pub impl(in super::path::to) trait Foo {}), | ||
| 843 | "pub impl(in super::path::to) trait Foo {}" | ||
| 844 | ); | ||
| 845 | assert_eq!( | ||
| 846 | stringify!(pub impl(in crate::path::to) trait Foo {}), | ||
| 847 | "pub impl(in crate::path::to) trait Foo {}" | ||
| 848 | ); | ||
| 849 | |||
| 850 | assert_eq!( | ||
| 851 | stringify!(pub auto impl(crate) trait Foo {}), | ||
| 852 | "pub auto impl(crate) trait Foo {}" | ||
| 853 | ); | ||
| 854 | assert_eq!( | ||
| 855 | stringify!(pub auto impl(in crate::path::to) trait Foo {}), | ||
| 856 | "pub auto impl(in crate::path::to) trait Foo {}" | ||
| 857 | ); | ||
| 858 | assert_eq!( | ||
| 859 | stringify!(pub unsafe impl(crate) trait Foo {}), | ||
| 860 | "pub unsafe impl(crate) trait Foo {}" | ||
| 861 | ); | ||
| 862 | assert_eq!( | ||
| 863 | stringify!(pub unsafe impl(in crate::path::to) trait Foo {}), | ||
| 864 | "pub unsafe impl(in crate::path::to) trait Foo {}" | ||
| 865 | ); | ||
| 866 | assert_eq!( | ||
| 867 | stringify!(pub const impl(crate) trait Foo {}), | ||
| 868 | "pub const impl(crate) trait Foo {}" | ||
| 869 | ); | ||
| 870 | assert_eq!( | ||
| 871 | stringify!(pub const impl(in crate::path::to) trait Foo {}), | ||
| 872 | "pub const impl(in crate::path::to) trait Foo {}" | ||
| 873 | ); | ||
| 874 | assert_eq!( | ||
| 875 | stringify!(pub unsafe auto impl(crate) trait Foo {}), | ||
| 876 | "pub unsafe auto impl(crate) trait Foo {}" | ||
| 877 | ); | ||
| 878 | assert_eq!( | ||
| 879 | stringify!(pub unsafe auto impl(in crate::path::to) trait Foo {}), | ||
| 880 | "pub unsafe auto impl(in crate::path::to) trait Foo {}" | ||
| 881 | ); | ||
| 882 | assert_eq!( | ||
| 883 | stringify!(pub const auto impl(crate) trait Foo {}), | ||
| 884 | "pub const auto impl(crate) trait Foo {}" | ||
| 885 | ); | ||
| 886 | assert_eq!( | ||
| 887 | stringify!(pub const auto impl(in crate::path::to) trait Foo {}), | ||
| 888 | "pub const auto impl(in crate::path::to) trait Foo {}" | ||
| 889 | ); | ||
| 890 | assert_eq!( | ||
| 891 | stringify!(pub const unsafe impl(crate) trait Foo {}), | ||
| 892 | "pub const unsafe impl(crate) trait Foo {}" | ||
| 893 | ); | ||
| 894 | assert_eq!( | ||
| 895 | stringify!(pub const unsafe impl(in crate::path::to) trait Foo {}), | ||
| 896 | "pub const unsafe impl(in crate::path::to) trait Foo {}" | ||
| 897 | ); | ||
| 898 | assert_eq!( | ||
| 899 | stringify!(pub const unsafe auto impl(crate) trait Foo {}), | ||
| 900 | "pub const unsafe auto impl(crate) trait Foo {}" | ||
| 901 | ); | ||
| 902 | assert_eq!( | ||
| 903 | stringify!(pub const unsafe auto impl(in crate::path::to) trait Foo {}), | ||
| 904 | "pub const unsafe auto impl(in crate::path::to) trait Foo {}" | ||
| 905 | ); | ||
| 906 | } | ||
| 907 | |||
| 803 | #[test] | 908 | #[test] |
| 804 | fn test_punct() { | 909 | fn test_punct() { |
| 805 | // For all these cases, we should preserve spaces between the tokens. | 910 | // For all these cases, we should preserve spaces between the tokens. |
tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs+1-1| ... | @@ -39,7 +39,7 @@ fn main() { | ... | @@ -39,7 +39,7 @@ fn main() { |
| 39 | // Everything below this is expected to compile successfully. | 39 | // Everything below this is expected to compile successfully. |
| 40 | 40 | ||
| 41 | // We only test matching here as we cannot create non-exhaustive | 41 | // We only test matching here as we cannot create non-exhaustive |
| 42 | // structs from another crate. ie. they'll never pass in run-pass tests. | 42 | // structs from another crate. i.e. they'll never pass in run-pass tests. |
| 43 | fn match_structs(ns: NormalStruct, ts: TupleStruct, us: UnitStruct) { | 43 | fn match_structs(ns: NormalStruct, ts: TupleStruct, us: UnitStruct) { |
| 44 | let NormalStruct { first_field, second_field, .. } = ns; | 44 | let NormalStruct { first_field, second_field, .. } = ns; |
| 45 | 45 |
tests/ui/rmeta/no_optimized_mir.rs created+14| ... | @@ -0,0 +1,14 @@ | ||
| 1 | //@ aux-build:rmeta-meta.rs | ||
| 2 | //@ no-prefer-dynamic | ||
| 3 | //@ build-fail | ||
| 4 | |||
| 5 | // Check that we do not ICE when we need optimized MIR but it is missing. | ||
| 6 | |||
| 7 | extern crate rmeta_meta; | ||
| 8 | |||
| 9 | fn main() { | ||
| 10 | rmeta_meta::missing_optimized_mir(); | ||
| 11 | } | ||
| 12 | |||
| 13 | //~? ERROR crate `rmeta_meta` required to be available in rlib format, but was not found in this form | ||
| 14 | //~? ERROR missing optimized MIR for `missing_optimized_mir` in the crate `rmeta_meta` | ||
tests/ui/rmeta/no_optimized_mir.stderr created+12| ... | @@ -0,0 +1,12 @@ | ||
| 1 | error: crate `rmeta_meta` required to be available in rlib format, but was not found in this form | ||
| 2 | |||
| 3 | error: missing optimized MIR for `missing_optimized_mir` in the crate `rmeta_meta` | ||
| 4 | | | ||
| 5 | note: missing optimized MIR for this item (was the crate `rmeta_meta` compiled with `--emit=metadata`?) | ||
| 6 | --> $DIR/auxiliary/rmeta-meta.rs:10:1 | ||
| 7 | | | ||
| 8 | LL | pub fn missing_optimized_mir() { | ||
| 9 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 10 | |||
| 11 | error: aborting due to 2 previous errors | ||
| 12 | |||
tests/ui/rmeta/no_optitimized_mir.rs deleted-13| ... | @@ -1,13 +0,0 @@ | ||
| 1 | //@ aux-build:rmeta-meta.rs | ||
| 2 | //@ no-prefer-dynamic | ||
| 3 | //@ build-fail | ||
| 4 | |||
| 5 | // Check that we do not ICE when we need optimized MIR but it is missing. | ||
| 6 | |||
| 7 | extern crate rmeta_meta; | ||
| 8 | |||
| 9 | fn main() { | ||
| 10 | rmeta_meta::missing_optimized_mir(); | ||
| 11 | } | ||
| 12 | |||
| 13 | //~? ERROR missing optimized MIR for `missing_optimized_mir` in the crate `rmeta_meta` | ||
tests/ui/rmeta/no_optitimized_mir.stderr deleted-10| ... | @@ -1,10 +0,0 @@ | ||
| 1 | error: missing optimized MIR for `missing_optimized_mir` in the crate `rmeta_meta` | ||
| 2 | | | ||
| 3 | note: missing optimized MIR for this item (was the crate `rmeta_meta` compiled with `--emit=metadata`?) | ||
| 4 | --> $DIR/auxiliary/rmeta-meta.rs:10:1 | ||
| 5 | | | ||
| 6 | LL | pub fn missing_optimized_mir() { | ||
| 7 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 8 | |||
| 9 | error: aborting due to 1 previous error | ||
| 10 | |||